config

package
v0.0.0-...-e10dee8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name    string `env-required:"true" yaml:"name"    env:"APP_NAME"`
	Version string `env-required:"true" yaml:"version" env:"APP_VERSION"`
}

type Config

type Config struct {
	App      `yaml:"app"`
	HTTP     `yaml:"http"`
	GRPC     `yaml:"grpc"`
	Log      `yaml:"log"`
	PG       `yaml:"postgres"`
	Service  `yaml:"service"`
	LinkGen  `yaml:"generator"`
	Redis    `yaml:"redis"`
	UseRedis bool
}

func NewConfig

func NewConfig() (*Config, error)

type GRPC

type GRPC struct {
	Port string `env-required:"true" yaml:"port" env:"GRPC_PORT"`
}

type HTTP

type HTTP struct {
	Port         string        `env-required:"true" yaml:"port" env:"HTTP_PORT"`
	WriteTimeout time.Duration `env-required:"true" yaml:"write_timeout" env:"WRITE_TIMEOUT"`
	ReadTimeout  time.Duration `env-required:"true" yaml:"read_timeout" env:"READ_TIMEOUT"`
}

type LinkGen

type LinkGen struct {
	Alphabet string `yaml:"alphabet"`
	Length   int    `yaml:"length"`
}

type Log

type Log struct {
	Level string `yaml:"log_level"`
}

type PG

type PG struct {
	Name     string `env:"DB_NAME"`
	User     string `env:"DB_USER"`
	Port     int    `env:"DB_PORT"`
	Password string `env:"DB_PASSWORD"`
	Host     string `env:"DB_HOST"`
	PoolMax  int    `yaml:"pool_max"`
}

type Redis

type Redis struct {
	Port string `env:"REDIS_PORT"`
	Host string `env:"REDIS_HOST"`
}

type Service

type Service struct {
	Host                  string `yaml:"host"`
	Port                  int    `yaml:"port"`
	RecalculationInterval int    `yaml:"interval"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳