package
Version:
v0.0.0-...-4db5c07
Opens a new window with list of versions in this module.
Published: Aug 17, 2023
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package config содержит конфигурацию сервера.
type App struct {
Name string `yaml:"name" env:"APP_NAME"`
Version string `yaml:"version" env:"APP_VERSION"`
}
App информация о приложении.
type Config struct {
App `yaml:"app"`
PG `yaml:"postgres"`
GRPC `yaml:"grpc"`
Token `yaml:"token"`
}
Config основная конфигурация.
New создаёт объект Config.
type GRPC struct {
Port string `yaml:"port" env:"GRPC_PORT"`
}
GRPC настройки gRPC.
type PG struct {
MaxOpen int `yaml:"pool_max" env:"PG_POOL_MAX"`
ConnAttempts int `yaml:"conn_attempts" env:"PG_CONN_ATTEMPTS"`
URL string `env-required:"true" env:"PG_URL"`
}
PG подключение к БД Postgres.
type Token struct {
Key string `env-required:"true" env:"TOKEN_KEY"`
AccessDuration time.Duration `env-required:"true" yaml:"access_duration" env:"TOKEN_ACCESS_DURATION"`
}
Token настройки для формирования токена.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.