Documentation
¶
Overview ¶
Package app provides methods to configure, run, and stop a go-app.
Index ¶
- func CustomSchema[T any](target T) ([]byte, error)
- func HasAppConfig[T any](target T) error
- func MustLoadConfigInto[T any](ctx context.Context, into T) (context.Context, T)
- func MustSetupConfigAndLogging(ctx context.Context) context.Context
- func MustSetupConfigAndLoggingInto[T any](ctx context.Context, into T) (context.Context, T)
- type App
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomSchema ¶ added in v0.7.0
CustomSchema generates json schema for custom config which embeds *config.AppConfig into it Panics if no *config.AppConfig is embedded into custom config type
See swaggest/jsonschema-go for struct tag docs
func HasAppConfig ¶ added in v0.7.0
func MustLoadConfigInto ¶ added in v0.3.1
MustLoadConfigInto is used to unmarshal config and environment into a custom type that overloads *config.AppConfig. Will perform normal env substitutions for AppConfig, but env overrides for custom type are up to the caller.
func MustSetupConfigAndLogging ¶
MustSetupConfigAndLogging is a helper function to return a context loaded up with config.AppConfig and a logger
func MustSetupConfigAndLoggingInto ¶ added in v0.3.1
MustSetupConfigAndLoggingInto will unmarshal config into a custom type Type MUST include *config.AppConfig Stored in context as *config.AppConfig but can be asserted back
Types ¶
type App ¶
type App struct { AppContext context.Context HTTP *httpopts.AppHTTP GRPC *grpcopts.AppGRPC // contains filtered or unexported fields }
App is the main application struct, holding its context, configurations, and various services like HTTP and gRPC.