config

package
v1.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2022 License: Unlicense Imports: 18 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Module for fx.
	// nolint:gochecknoglobals
	Module = fx.Options(ConfiguratorModule, UnmarshalModule, ConfigModule)

	// ConfiguratorModule for fx.
	// nolint:gochecknoglobals
	ConfiguratorModule = fx.Provide(NewConfigurator)

	// UnmarshalModule for fx.
	// nolint:gochecknoglobals
	UnmarshalModule = fx.Invoke(Unmarshal)

	// ConfigModule for fx.
	// nolint:gochecknoglobals
	ConfigModule = fx.Options(
		fx.Provide(redisConfig), fx.Provide(ristrettoConfig),
		fx.Provide(auth0Config),
		fx.Provide(pgConfig),
		fx.Provide(datadogConfig), fx.Provide(jaegerConfig),
		fx.Provide(grpcConfig), fx.Provide(httpConfig), fx.Provide(nsqConfig),
	)
)
View Source
var ErrMissingConfigFile = errors.New("missing config file")

ErrMissingConfigFile for config.

Functions

func Unmarshal

func Unmarshal(cfg Configurator) error

Unmarshal the config.

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 (cfg *Config) Auth0Config() *auth0.Config

func (*Config) DatadogConfig

func (cfg *Config) DatadogConfig() *datadog.Config

func (*Config) GRPCConfig

func (cfg *Config) GRPCConfig() *grpc.Config

func (*Config) HTTPConfig

func (cfg *Config) HTTPConfig() *http.Config

func (*Config) JaegerConfig

func (cfg *Config) JaegerConfig() *jaeger.Config

func (*Config) NSQConfig

func (cfg *Config) NSQConfig() *nsq.Config

func (*Config) PGConfig

func (cfg *Config) PGConfig() *pg.Config

func (*Config) RedisConfig

func (cfg *Config) RedisConfig() *redis.Config

func (*Config) RistrettoConfig

func (cfg *Config) RistrettoConfig() *ristretto.Config

func (*Config) Unmarshal

func (cfg *Config) Unmarshal(bytes []byte) error

type Configurator

type Configurator interface {
	Unmarshal(in []byte) error
	RedisConfig() *redis.Config
	RistrettoConfig() *ristretto.Config
	Auth0Config() *auth0.Config
	PGConfig() *pg.Config
	DatadogConfig() *datadog.Config
	JaegerConfig() *jaeger.Config
	GRPCConfig() *grpc.Config
	HTTPConfig() *http.Config
	NSQConfig() *nsq.Config
}

Configurator for config.

func NewConfigurator

func NewConfigurator() Configurator

NewConfigurator for config. nolint:ireturn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL