Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder build configuration with some options.
func (*Builder) AddConfigFile ¶
AddConfigFile read config file from filePath.
func (*Builder) Build ¶
func (builder *Builder) Build() (Configuration, error)
Build return new configuration instance.
type Configuration ¶
type Configuration struct { Addr string `mapstructure:"addr"` Postgres PostgresConfig `mapstructure:"postgres"` Jwt JwtConfig `mapstructure:"jwt"` Redis RedisConfig `mapstructure:"redis"` }
Configuration is config type.
type JwtConfig ¶
type JwtConfig struct { SecretKey string `mapstructure:"secret_key"` AccessExpiresInSec int64 `mapstructure:"access_expires_sec"` RefreshExpiresInSec int64 `mapstructure:"refresh_expires_sec"` }
JwtConfig is jwt config
type PostgresConfig ¶
type PostgresConfig struct { Driver string `mapstructure:"driver"` Host string `mapstructure:"host"` Port string `mapstructure:"port"` User string `mapstructure:"user"` Name string `mapstructure:"name"` Password string `mapstructure:"password"` }
PostgresConfig is postgres config
type RedisConfig ¶
type RedisConfig struct {
Addr string `mapstructure:"addr"`
}
RedisConfig is redis config
Click to show internal directories.
Click to hide internal directories.