config

package
v0.0.0-...-28981a6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundTasksConfig

type BackgroundTasksConfig struct {
	PeriodMinutes          int `envconfig:"PERIOD_MINUTES" required:"true"`
	SupportedCurrencyPairs map[string]string
}

func (BackgroundTasksConfig) GetCurrencyPairs

func (b BackgroundTasksConfig) GetCurrencyPairs() (map[string][]string, error)

type CheckConfig

type CheckConfig struct {
	PeriodSeconds int `envconfig:"PERIOD_SECONDS" required:"true"`
}

type Config

type Config struct {
	AppName              string
	LogLevel             string                `envconfig:"LOG_LEVEL" required:"true"`
	ShutdownPauseSeconds int                   `envconfig:"SHUTDOWN_PAUSE_SECONDS" required:"true"`
	StartupCheck         CheckConfig           `envconfig:"STARTUP_CHECK" required:"true"`
	Postgres             PostgresConfig        `envconfig:"POSTGRES" required:"true"`
	FastForex            FastForexConfig       `envconfig:"FAST_FOREX" required:"true"`
	HTTPServer           HTTPServerConfig      `envconfig:"HTTP_SERVER" required:"true"`
	BackgroundTasks      BackgroundTasksConfig `envconfig:"BACKGROUND_TASKS" required:"true"`
}

func Get

func Get(logger zerolog.Logger) *Config

type FastForexConfig

type FastForexConfig struct {
	APIKey string `envconfig:"API_KEY" required:"true"`
}

type HTTPClientConfig

type HTTPClientConfig struct {
	Host     string `envconfig:"HOST" required:"true"`
	Endpoint string `envconfig:"ENDPOINT" required:"true"`
}

type HTTPServerConfig

type HTTPServerConfig struct {
	Port int `envconfig:"PORT" required:"true"`
}

type PostgresConfig

type PostgresConfig struct {
	DB       string `envconfig:"DB" required:"true"`
	Host     string `envconfig:"HOST" required:"true"`
	User     string `envconfig:"USER" required:"true"`
	Password string `envconfig:"PASSWORD" required:"true"`
	Port     int    `envconfig:"PORT" required:"true"`
}

func (PostgresConfig) GetAddress

func (p PostgresConfig) GetAddress() string

func (PostgresConfig) GetURL

func (p PostgresConfig) GetURL() string

Jump to

Keyboard shortcuts

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