config

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Exchange ExchangeConfig `env:",prefix=EXCHANGE_,required"`
	Database DatabaseConfig `env:",prefix=DB_,required"`
	Logger   LoggerConfig   `env:",prefix=LOGGER_"`
}

Config default config structure

func NewConfig

func NewConfig(ctx context.Context) (*Config, error)

NewConfig init default config for application

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `env:"HOST,required"`
	User     string `env:"USER,required"`
	Password string `env:"PASSWORD"`
	Base     string `env:"BASE"`
}

DatabaseConfig for db config

type ExchangeConfig

type ExchangeConfig struct {
	Url      string   `env:"URL,required"`
	Origin   string   `env:"ORIGIN,required"`
	Protocol string   `env:"PROTOCOL,default="`
	Symbols  []string `env:"SYMBOLS,required"`
	Channels []string `env:"CHANNELS,required"`
}

ExchangeConfig for exchange configuration

type LoggerConfig

type LoggerConfig struct {
	DisableCaller     bool   `env:"CALLER,default=false"`
	DisableStacktrace bool   `env:"STACKTRACE,default=false"`
	Level             string `env:"LEVEL,default=debug"`
}

LoggerConfig for logger configuration

Jump to

Keyboard shortcuts

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