config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 5 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 {
	Address      string        `yaml:"address"`
	Timeout      time.Duration `yaml:"timeout"`
	RetriesCount int           `yaml:"retriesCount"`
}

type ClientConfig

type ClientConfig struct {
	SSO Client `yaml:"sso"`
}

type Config

type Config struct {
	Env        string  `yaml:"env" env-default:"local"`
	Storage    Storage `yaml:"storage" env-required:"true"`
	HTTPServer `yaml:"http_server"`
	Clients    ClientConfig `yaml:"clients"`
	AppSecret  string       `yaml:"app_secret" env-required:"true" env:"APP_SECRET"`
}

func MustLoad

func MustLoad() *Config

Must - обозначает, что функция либо выполнится, либо вызовет панику

type HTTPServer

type HTTPServer struct {
	Address     string        `yaml:"address" env-default:":8080"`
	Timeout     time.Duration `yaml:"timeout" env-default:"4s"`
	IdleTimeout time.Duration `yaml:"idle_timeout" env-default:"60s"`
	User        string        `yaml:"user" env-required:"true"`
	Password    string        `yaml:"password" env-required:"true" env:"HTTP_SERVER_PASSWORD"`
}

type Storage

type Storage struct {
	Host            string `yaml:"host" env-required:"true"`
	Port            string `yaml:"port" env-required:"true"`
	Dbname          string `yaml:"dbname" env-required:"true" env:"POSTGRES_DB"`
	User            string `yaml:"user" env-required:"true" env:"POSTGRES_USER"`
	Password        string `yaml:"password" env-required:"true" env:"POSTGRES_PASSWORD"`
	Migrations_path string `yaml:"migrations_path" env-required:"true"`
}

Jump to

Keyboard shortcuts

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