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() fx.Option
- func NewCommonOpts(cfg *Config, ropts RunOptions) []fx.Option
- func SetFXRunOpts(opts RunOptions)
- func StartDB(ctx context.Context, cfg *Config) (db.DB, error)
- type Config
- type RunOptions
Constants ¶
View Source
const Delim = "."
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
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 ¶
func HookSimpleOnStop ¶ added in v0.4.3
func LoggerFxOpt ¶
func NewCommonOpts ¶
func NewCommonOpts(cfg *Config, ropts RunOptions) []fx.Option
func SetFXRunOpts ¶
func SetFXRunOpts(opts RunOptions)
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
TODO: need to find a way to list all expected keys.
func LoadConfig ¶
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.
Click to show internal directories.
Click to hide internal directories.