config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDataRetentionInDays = 30

Variables

This section is empty.

Functions

This section is empty.

Types

type YamlConfig

type YamlConfig struct {
	DbHost              string `yaml:"dbhost" validate:"required"`
	DbPort              string `yaml:"dbport" validate:"required,gte=1,lte=65535"`
	DbUser              string `yaml:"dbuser" validate:"required"`
	DbPassword          string `yaml:"dbpassword" validate:"required"`
	DbName              string `yaml:"dbname" validate:"required"`
	LogLevel            string `yaml:"loglevel" `
	RedisHost           string `yaml:"redis_host" validate:"required"`
	RedisPort           string `yaml:"redis_port" validate:"required"`
	RedisPassword       string `yaml:"redis_password"`
	RedisStream         string `yaml:"redis_stream" validate:"required"`
	DataRetentionInDays int    `yaml:"data_retention_in_days" validate:"required,gte=1"`
}

Struct representing the yaml configuration file passed as a parameter to the program

func LoadConfigFromEnv

func LoadConfigFromEnv() *YamlConfig

func LoadConfigFromFile

func LoadConfigFromFile(filename string) (*YamlConfig, error)

func (*YamlConfig) IsConfigValid

func (cfg *YamlConfig) IsConfigValid() error

Jump to

Keyboard shortcuts

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