cfg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Token string `yaml:"token" env:"AUTH_TOKEN" env-description:"API security token"`
}

type LogsConfig

type LogsConfig struct {
	AddSource bool   `yaml:"add_source" env:"LOGS_ADD_SOURCE" env-default:"false" env-description:"Defines if function source is added to log line"`
	Level     int    `yaml:"level" env:"LOGS_LEVEL" env-default:"0" env-description:"Minimal log level"`
	Format    string `yaml:"format" env:"LOGS_FORMAT" env-default:"txt" env-description:"Logging default format"`
	File      string `yaml:"file" env:"LOGS_FILE" env-description:"Logging file path"`
}

type RedisConfig

type RedisConfig struct {
	Host string `yaml:"host" env:"REDIS_HOST" env-default:"0.0.0.0" env-description:"Redis cache server host"`
	Port uint64 `yaml:"port" env:"REDIS_PORT" env-default:"6379" env-description:"Redis cache server port"`

	Database int `yaml:"database" env:"REDIS_DB" env-description:"Redis database name"`

	Username string `yaml:"username" env:"REDIS_USER" env-default:"default" env-description:"Redis connection username"`
	Password string `yaml:"password" env:"REDIS_PASS" env-default:"" env-description:"Redis connection user password"`

	Consumer string   `yaml:"queue_consumer" env:"REDIS_QUEUE_CONSUMER" env-default:"" env-description:"Redis queue consumer identity"`
	Group    string   `yaml:"queue_group" env:"REDIS_QUEUE_GROUP" env-default:"whois_tasks" env-description:"Redis queue name"`
	Streams  []string `yaml:"queue_streams" env:"REDIS_QUEUE_STREAMS" env-description:"List of Redis queue streams"`

	MaxRetries uint64        `yaml:"max_retries" env:"REDIS_MAX_RETRIES" env-default:"3" env-description:"Redis query max retries"`
	DialTimout time.Duration `yaml:"dial_timout" env:"REDIS_DIAL_TIMOUT" env-default:"3000ms" env-description:"Redis max dial timout"`
}

type ServerConfig

type ServerConfig struct {
	Host string `yaml:"host" env:"SRV_HOST" env-default:"0.0.0.0" env-description:"Server listener host"`
	Port uint64 `yaml:"port" env:"SRV_PORT" env-default:"6379" env-description:"Server listener port"`

	Reflection bool `yaml:"reflection" env:"SRV_REFLECTION" env-default:"false" env-description:"Enables GRPC reflection"`
	Health     bool `yaml:"health" env:"SRV_HEALTH" env-default:"true" env-description:"Enables GRPC health checks"`
}

Jump to

Keyboard shortcuts

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