config

package
v0.0.4 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 Config

type Config struct {
	Env      string        `yaml:"env" env-default:"local"`
	TokenTTL time.Duration `yaml:"token_ttl" env-default:"1h"`
	GRPC     `yaml:"grpc"`
	Storage  `yaml:"storage"`
}

func MustLoad

func MustLoad() *Config

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

func MustLoadByPath

func MustLoadByPath(configPath string) *Config

type GRPC

type GRPC struct {
	Host    string        `yaml:"host" env-default:""`
	Port    string        `yaml:"port" env-default:"44044"`
	Timeout time.Duration `yaml:"timeout" env-default:"15s"`
}

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