config

package
v0.0.0-...-acfc36b Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 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 Config

type Config struct {
	// BindAddr представляет адрес сервера.
	BindAddr string `yaml:"bind_addr" env:"BIND_ADDR"`
	// DSN (data source name) является строкой подключения к базе данных.
	DSN string `yaml:"dsn" env:"DSN,secret"`
	// LogLevel представляет уровень логгирования.
	LogLevel string `yaml:"log_level" env:"LOG_LEVEL"`
}

Config содержит настройки сервиса.

func Load

func Load(ymlConfigPath string) (*Config, error)

Load загружает настройки сервиса из переменных среды и, если их не окажется, из yml-файла.

func (Config) Validate

func (c Config) Validate() error

Validate проверяет, достаточно ли настроек для запуска сервиса.

Jump to

Keyboard shortcuts

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