Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FxConfig = fx.Module( "fxconfig", fx.Provide( NewConfig, NewConfigAccessor, ), )
Functions ¶
Types ¶
type Accessor ¶
type Accessor struct{}
Accessor provides Yokai-style config access e.g., fxConfig.Config().String("app.name")
func ConfigAccessor ¶
func ConfigAccessor() *Accessor
ConfigAccessor returns the global config accessor, Yokai-style
func NewConfigAccessor ¶
func NewConfigAccessor() *Accessor
NewConfigAccessor returns the config accessor for DI
func (*Accessor) AllSettings ¶
type Config ¶
type Config struct {
App struct {
Name string `mapstructure:"name"`
Port string `mapstructure:"port"`
} `mapstructure:"app"`
Database struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
DBName string `mapstructure:"dbname"`
SSLMode string `mapstructure:"sslmode"`
} `mapstructure:"database"`
Accessor *Accessor
}
func (*Config) PostgresDSN ¶
Click to show internal directories.
Click to hide internal directories.