config

package
v0.0.0-...-8738c73 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Timeout   time.Duration `env:"CLIENT_TIMEOUT" env-default:"5s"`
	UserAgent string        `env:"USER_AGENT" env-default:"Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko"`
}

type Config

type Config struct {
	Env     string `env:"APP_ENV" env-default:"local"`
	LogFile string `env:"APP_LOG_FILE" env-default:""`
	Server  Server
	Client  Client
	Loger   *slog.Logger
}

Структура конфигурации Файл конфигурации должен распологаться в корне проекта и иметь имя config.yaml

func MustLoad

func MustLoad() *Config

type Server

type Server struct {
	BindAddr    string        `env:"SERVER_BIND_ADDR" env-default:":8080"`
	Timeout     time.Duration `env:"TIMEOUT" env-default:"5s"`
	IdleTimeout time.Duration `env:"IDDLE" env-default:"30s"`
	SSLEnabled  bool          `env:"SSL_ENABLE" env-default:"false"`
	KeyChain    string        `env:"SSL_CHAIN" env-default:""`
	PrivateKey  string        `env:"SSL_KEY" env-default:""`
	ApiKey      string        `env:"API_KEY" env-default:""`
}

Jump to

Keyboard shortcuts

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