config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Environment     string
	LogLevel        string `envconfig:"LOG_LEVEL" default:"DEBUG"`
	DB              DBConfig
	Nats            NatsConfig
	Rpc             rpc.RpcConfig
	Web             web.WebConfig
	Otel            OtelConfig
	ShutdownTimeout time.Duration `envconfig:"SHUTDOWN_TIMEOUT" default:"30s"`
}

func InitConfig

func InitConfig() (cfg AppConfig, err error)

type DBConfig added in v0.1.3

type DBConfig struct {
	Driver string `envconfig:"DB_DRIVER" default:"mongo"`
	Conn   string `required:"true"`
}

type NatsConfig

type NatsConfig struct {
	URL    string `required:"true"`
	Stream string `default:"goevents"`
}

type OtelConfig

type OtelConfig struct {
	ServiceName      string `envconfig:"SERVICE_NAME" default:"goevents"`
	ExporterEndpoint string `envconfig:"EXPORTER_OTLP_ENDPOINT" default:"http://collector:4317"`
}

Jump to

Keyboard shortcuts

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