Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "appconfig", fx.Provide( func(log *zap.Logger) Config { if err := config.LoadConfig(&defaultConfig); err != nil { log.Error("Error loading config", zap.Error(err)) } return defaultConfig }, ), fx.Provide(func(cfg Config) http.Config { return http.Config{ Listen: cfg.HTTP.Listen, } }), fx.Provide(func(cfg Config) db.Config { return db.Config{ Dialect: cfg.Database.Dialect, Host: cfg.Database.Host, Port: cfg.Database.Port, User: cfg.Database.User, Password: cfg.Database.Password, Database: cfg.Database.Database, Timezone: cfg.Database.Timezone, } }), fx.Provide(func(cfg Config) services.PushServiceConfig { return services.PushServiceConfig{ CredentialsJSON: cfg.FCM.CredentialsJSON, } }), fx.Provide(func(cfg Config) tasks.HashingTaskConfig { return tasks.HashingTaskConfig{ Interval: time.Duration(cfg.Tasks.Hashing.IntervalSeconds) * time.Second, } }), )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { Dialect string `yaml:"dialect" envconfig:"DATABASE__DIALECT"` Host string `yaml:"host" envconfig:"DATABASE__HOST"` Port int `yaml:"port" envconfig:"DATABASE__PORT"` User string `yaml:"user" envconfig:"DATABASE__USER"` Password string `yaml:"password" envconfig:"DATABASE__PASSWORD"` Database string `yaml:"database" envconfig:"DATABASE__DATABASE"` Timezone string `yaml:"timezone" envconfig:"DATABASE__TIMEZONE"` }
type HashingTask ¶ added in v1.4.0
type HashingTask struct {
IntervalSeconds uint16 `yaml:"interval_seconds"`
}
type Tasks ¶ added in v1.4.0
type Tasks struct {
Hashing HashingTask `yaml:"hashing"`
}
Click to show internal directories.
Click to hide internal directories.