config

package
v0.0.0-...-da5a4cc Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAPIConfig

type AdminAPIConfig struct {
	Logger        logger.LogConfig
	Basic         BasicConfig
	DB            DBConfig
	ServerOptions ServerOptionsConfig
	JWT           JWTConfig `envPrefix:"JWT_"`
}

func GetAdminAPIConfig

func GetAdminAPIConfig() *AdminAPIConfig

func (*AdminAPIConfig) Validate

func (c *AdminAPIConfig) Validate() error

type BasicConfig

type BasicConfig struct {
	Environment      string `env:"ENVIRONMENT" envDefault:"local"`
	Namespace        string `env:"NAMESPACE" envDefault:"aggregator"`
	AppName          string `env:"APP_NAME" envDefault:"main-api"`
	PrometheusPrefix string `env:"PROMETHEUS_PREFIX" envDefault:"aggregator"`
}

type DBConfig

type DBConfig struct {
	Scheme  string `env:"BACKEND_DB_SCHEME" envDefault:"postgres"`
	ConnStr string `env:"BACKEND_DB_CONN_STR,required"`
}

type IConfig

type IConfig interface {
	Validate() error
}

type JWTConfig

type JWTConfig struct {
	AccessSecret  string `env:"ACCESS_SECRET" envDefault:"access-secret"`
	RefreshSecret string `env:"REFRESH_SECRET" envDefault:"refresh-secret"`
	SigningKey    string `env:"SIGNING_KEY" envDefault:"WcPGXClpKD7Bc1C0CCDA1060E2GGlTfamrd8-W0ghBE"`
}

type ServerOptionsConfig

type ServerOptionsConfig struct {
	Bind         string        `env:"SERVER_BIND" envDefault:":9000"`
	ProbeBind    string        `env:"SERVER_PROBE_BIND" envDefault:":9091"`
	MetricsBind  string        `env:"SERVER_METRICS_BIND" envDefault:":9090"`
	ReadTimeout  time.Duration `env:"SERVER_READ_TIMEOUT" envDefault:"40s"`
	WriteTimeout time.Duration `env:"SERVER_WRITE_TIMEOUT" envDefault:"40s"`
	IdleTimeout  time.Duration `env:"SERVER_IDLE_TIMEOUT" envDefault:"40s"`
}

type UserAPIConfig

type UserAPIConfig struct {
	Logger        logger.LogConfig
	Basic         BasicConfig
	DB            DBConfig
	ServerOptions ServerOptionsConfig
	JWT           JWTConfig `envPrefix:"JWT_"`
}

func GetUserAPIConfig

func GetUserAPIConfig() *UserAPIConfig

func (*UserAPIConfig) Validate

func (c *UserAPIConfig) Validate() error

Jump to

Keyboard shortcuts

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