Documentation ¶
Index ¶
- Variables
- func File() string
- func FileFromEnv(env string) string
- func MarshalToBytes(cfg Map) ([]byte, error)
- func ReadFile() ([]byte, error)
- func ReadFileFromEnv(env string) ([]byte, error)
- func UnmarshalFromBytes(bytes []byte, cfg Map) error
- func UnmarshalFromFile(cfg Configurator) error
- func Watch(params WatchParams) error
- func WriteFileToEnv(env string, data []byte) error
- type Config
- func (cfg *Config) Auth0Config() *auth0.Config
- func (cfg *Config) GRPCConfig() *grpc.Config
- func (cfg *Config) HTTPConfig() *http.Config
- func (cfg *Config) NSQConfig() *nsq.Config
- func (cfg *Config) OpentracingConfig() *opentracing.Config
- func (cfg *Config) PGConfig() *pg.Config
- func (cfg *Config) RedisConfig() *redis.Config
- func (cfg *Config) RistrettoConfig() *ristretto.Config
- type Configurator
- type Map
- type WatchParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Module for fx. Module = fx.Options(ConfiguratorModule, UnmarshalModule, ConfigModule, WatchModule) // ConfiguratorModule for fx. ConfiguratorModule = fx.Provide(NewConfigurator) // UnmarshalModule for fx. UnmarshalModule = fx.Invoke(UnmarshalFromFile) // WatchModule for fx. WatchModule = fx.Invoke(Watch) // ConfigModule for fx. ConfigModule = fx.Options( fx.Provide(redisConfig), fx.Provide(ristrettoConfig), fx.Provide(auth0Config), fx.Provide(pgConfig), fx.Provide(opentracingConfig), fx.Provide(grpcConfig), fx.Provide(httpConfig), fx.Provide(nsqConfig), ) )
Functions ¶
func MarshalToBytes ¶ added in v1.44.0
MarshalToBytes the map.
func ReadFileFromEnv ¶ added in v1.62.0
ReadFileFromEnv variable of config location.
func UnmarshalFromBytes ¶ added in v1.44.0
UnmarshalFromBytes to map.
func UnmarshalFromFile ¶ added in v1.44.0
func UnmarshalFromFile(cfg Configurator) error
UnmarshalFromFile to config.
func Watch ¶ added in v1.60.0
func Watch(params WatchParams) error
Watch the configuration. If it changes terminate the application.
func WriteFileToEnv ¶ added in v1.43.0
WriteFileToEnv location.
Types ¶
type Config ¶
type Config struct { Cache cache.Config `yaml:"cache"` Security security.Config `yaml:"security"` SQL sql.Config `yaml:"sql"` Trace trace.Config `yaml:"trace"` Transport transport.Config `yaml:"transport"` }
Config for the service.
func (*Config) Auth0Config ¶
func (*Config) GRPCConfig ¶
func (*Config) HTTPConfig ¶
func (*Config) OpentracingConfig ¶ added in v1.64.0
func (cfg *Config) OpentracingConfig() *opentracing.Config
func (*Config) RedisConfig ¶
func (*Config) RistrettoConfig ¶
type Configurator ¶
type Configurator interface { RedisConfig() *redis.Config RistrettoConfig() *ristretto.Config Auth0Config() *auth0.Config PGConfig() *pg.Config OpentracingConfig() *opentracing.Config GRPCConfig() *grpc.Config HTTPConfig() *http.Config NSQConfig() *nsq.Config }
Configurator for config.
type WatchParams ¶ added in v1.60.0
type WatchParams struct { fx.In Lifecycle fx.Lifecycle Shutdowner fx.Shutdowner Logger *zap.Logger }
WatchParams for config.
Click to show internal directories.
Click to hide internal directories.