config

package
v0.0.0-...-d9f1a53 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainComponentId    = 1
	MainGroupId        = 1
	RedisExpire        = 1 * time.Hour
	ShutdownTimeout    = 1 * time.Minute
	MaxLoopInExecution = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresConfig

type PostgresConfig struct {
	Db   string `env:"POSTGRES_DB,required"`
	User string `env:"POSTGRES_USER,required"`
	Pass string `env:"POSTGRES_PASSWORD,required"`
	Host string `env:"POSTGRES_HOST,required"`
	Port string `env:"POSTGRES_PORT,required"`
}

type RedisConfig

type RedisConfig struct {
	Db   int    `env:"REDIS_DB,required"`
	Pass string `env:"REDIS_PASS,required"`
	Host string `env:"REDIS_HOST,required"`
	Port string `env:"REDIS_PORT,required"`
}

type ServiceConfig

type ServiceConfig struct {
	LoggerType    string `env:"LOGGER_TYPE,required"`
	WebhookPath   string `env:"WEBHOOK_PATH,required"`
	ListenAddress string `env:"LISTEN_ADDRESS,required"`
	Redis         RedisConfig
	Pg            PostgresConfig
	NatsURL       string `env:"NATS_URL,required"`
}

func GetConfig

func GetConfig() (*ServiceConfig, error)

Jump to

Keyboard shortcuts

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