config

package
v1.86.21 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Unlicense Imports: 15 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

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

	// ConfiguratorModule for fx.
	ConfiguratorModule = fx.Provide(NewConfigurator)

	// UnmarshalModule for fx.
	UnmarshalModule = fx.Invoke(Unmarshal)

	// ConfigModule for fx.
	ConfigModule = fx.Options(
		fx.Provide(redisConfig), fx.Provide(ristrettoConfig),
		fx.Provide(auth0Config),
		fx.Provide(pgConfig),
		fx.Provide(otelConfig),
		fx.Provide(transportConfig),
		fx.Provide(grpcConfig),
		fx.Provide(httpConfig),
		fx.Provide(nsqConfig),
	)
)

Functions

func Unmarshal

func Unmarshal(params UnmarshalParams) error

Unmarshal to config.

Types

type Config

type Config struct {
	Cache     cache.Config     `yaml:"cache" json:"cache" toml:"cache"`
	Security  security.Config  `yaml:"security" json:"security" toml:"security"`
	SQL       sql.Config       `yaml:"sql" json:"sql" toml:"sql"`
	OTEL      otel.Config      `yaml:"otel" json:"otel" toml:"otel"`
	Transport transport.Config `yaml:"transport" json:"transport" toml:"transport"`
}

Config for the service.

func (*Config) Auth0Config

func (cfg *Config) Auth0Config() *auth0.Config

func (*Config) GRPCConfig

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

func (*Config) HTTPConfig

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

func (*Config) NSQConfig

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

func (*Config) OTELConfig added in v1.86.0

func (cfg *Config) OTELConfig() *otel.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) TransportConfig added in v1.70.0

func (cfg *Config) TransportConfig() *transport.Config

type Configurator

type Configurator interface {
	RedisConfig() *redis.Config
	RistrettoConfig() *ristretto.Config
	Auth0Config() *auth0.Config
	PGConfig() *pg.Config
	OTELConfig() *otel.Config
	TransportConfig() *transport.Config
	GRPCConfig() *grpc.Config
	HTTPConfig() *http.Config
	NSQConfig() *nsq.Config
}

Configurator for config.

func NewConfigurator

func NewConfigurator() Configurator

NewConfigurator for config.

type UnmarshalParams added in v1.78.0

type UnmarshalParams struct {
	fx.In

	Configurator Configurator
	Config       *cmd.InputConfig
}

UnmarshalParams for config.

Jump to

Keyboard shortcuts

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