Documentation ¶
Index ¶
- Constants
- func Component[T any](name string, set configset.Set[T], opts ...fx.Option) fx.Option
- func DBFxOpt() fx.Option
- func GetConfig[T any](c *Config, path string, def T) (*T, error)
- func HookOnStart(lc fx.Lifecycle, f func(context.Context) error)
- func HookOnStop(lc fx.Lifecycle, f func(context.Context) error)
- func HookSimpleOnStart(lc fx.Lifecycle, f func())
- func HookSimpleOnStop(lc fx.Lifecycle, f func())
- func LoggerFxOpt(silent bool) fx.Option
- func NewOpts(cfg *Config, ropts RunOptions) []fx.Option
- func StartDB(ctx context.Context, cfg *Config, ropt RunOptions) (db.DB, error)
- type Config
- type HTTPServerAddr
- type RunOptions
Constants ¶
View Source
const Delim = "."
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶ added in v0.4.6
GetConfig returns the unmarshalled configuration in `path`. If `path` does not exist, `def` is returned. Unmarshalling is done into a prepopulated config with `def`.
func HookSimpleOnStart ¶ added in v0.4.6
func HookSimpleOnStop ¶ added in v0.4.6
func LoggerFxOpt ¶ added in v0.4.6
Types ¶
type Config ¶ added in v0.4.6
type Config struct {
// contains filtered or unexported fields
}
TODO: need to find a way to list all expected keys.
func LoadConfig ¶ added in v0.4.6
TODO: make sure confmapvs maps to real pre-registered keys. If envVarPrefix is empty, do not load from environment. If yamlPath is empty, do not load from file.
type HTTPServerAddr ¶ added in v0.4.6
type HTTPServerAddr string
Click to show internal directories.
Click to hide internal directories.