niki/paymentapp/config.go

33 lines
997 B
Go

package paymentapp
import "time"
type GrpcConfig struct {
Port int `yaml:"port"`
NetworkType string `yaml:"type"`
ShutDownCtxTimeout time.Duration `yaml:"shutdown_context_timeout"`
}
type PostgresConfig struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Driver string `yaml:"driver"`
User string `yaml:"user"`
Password string `yaml:"password"`
DbName string `yaml:"dbName"`
SSLMode string `yaml:"sslMode"`
MaxIdleConns int `yaml:"maxIdleConns"`
MaxOpenConns int `yaml:"maxOpenConns"`
ConnMaxLifetime int `yaml:"connMaxLifetime"`
PathOfMigrations string `yaml:"pathOfMigrations"`
}
type LoggerConfig struct {
Level string `yaml:"level" json:"level"`
}
type Config struct {
Grpc GrpcConfig `yaml:"grpc" json:"grpc"`
Postgres PostgresConfig `yaml:"postgres" json:"postgres"`
Logger LoggerConfig `yaml:"logger" json:"logger"`
}