Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Config ¶
type Config struct {
AppDir string
Env string
ServerAdr string `yaml:"server_addr"`
Postgre *Postgre `yaml:"postgre"`
Redis *RedisRing `yaml:"redis"`
Cache *Cache `yaml:"cache"`
Debug bool `yaml:"debug"`
Logger *Logger `yaml:"log"`
}
func LoadConfigEnv ¶
type Logger ¶
Струкура определяет формат ведения лога. Возможные значения: std - вывод лога в стандартный поток os.Stderr (значение по умолчанию), net - отправка сообщений на сервер RPC, file - запись в текстовый файл.
type Postgre ¶
type Postgre struct {
Enable bool `yaml:"enable"`
Host string `yaml:"host"`
Port string `yaml:"port"`
MaxConns uint32 `yaml:"pool_max_conns"` // int32(4)
MinConns uint32 `yaml:"pool_min_conns"` // int32(0)
PoolMaxConnLifetime string `yaml:"pool_max_conn_lifetime"` // "1h"
PoolMaxConnIdleTime string `yaml:"pool_max_conn_idle_time"` // "30m"
PoolHealthPeriod string `yaml:"pool_health_check_period"` // "1m"
Dsn string
}
type RedisRing ¶
type RedisRing struct {
Enable bool `yaml:"enable"`
Addrs map[string]string `yaml:"addrs"`
Password string `yaml:"password"`
DB int `yaml:"db"`
PoolSize int `yaml:"pool_size"`
MaxRetries int `yaml:"max_retries"`
PoolTimeout string `yaml:"pool_timeout"`
IdleTimeout string `yaml:"idle_timeout"`
DialTimeout string `yaml:"dial_timeout"`
ReadTimeout string `yaml:"read_timeout"`
WriteTimeout string `yaml:"write_timeout"`
}
func (*RedisRing) Options ¶
func (cfg *RedisRing) Options() *redis.RingOptions
Click to show internal directories.
Click to hide internal directories.