app

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2025 License: MIT Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomSchema added in v0.7.0

func CustomSchema[T any](target T) ([]byte, error)

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 HasAppConfig[T any](target T) error

func MustLoadConfigInto added in v0.3.1

func MustLoadConfigInto[T any](ctx context.Context, into T) (context.Context, T)

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

func MustSetupConfigAndLogging(ctx context.Context) context.Context

Helper function to return a context loaded up with config.AppConfig and a logger

func MustSetupConfigAndLoggingInto added in v0.3.1

func MustSetupConfigAndLoggingInto[T any](ctx context.Context, into T) (context.Context, T)

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
}

func (*App) Done

func (a *App) Done() <-chan any

func (*App) MustRun

func (a *App) MustRun()

func (*App) Schema added in v0.7.0

func (app *App) Schema() ([]byte, error)

Generates json schema for app's config.AppConfig

func (*App) Shutdown

func (a *App) Shutdown()

Typically invoked when AppContext is done or Server has exited. Not intended to be called manually

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL