Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EnvKeyReplacer = strings.NewReplacer(".", "_", "-", "_")
EnvKeyReplacer replace for environment variable parse
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { Name string `mapstructure:"name"` Environment string `mapstructure:"environment"` Port string `mapstructure:"port"` Auth AuthConfig `mapstructure:"auth"` }
type AuthConfig ¶
type AuthConfig struct { AccessTokenType string `mapstructure:"access-token-type"` AccessTokenDuration time.Duration `mapstructure:"access-token-duration"` RefreshTokenDuration time.Duration `mapstructure:"refresh-token-duration"` JWTPrivateKey string `mapstructure:"jwt-private-key"` PasetoSymmetricKey string `mapstructure:"paseto-symmetric-key"` }
type CacheConfig ¶
type CacheConfig struct {
Redis RedisConfig `mapstructure:"redis"`
}
type Config ¶
type Config struct { App AppConfig `mapstructure:"app"` Cache CacheConfig `mapstructure:"cache"` DB DBConfig `mapstructure:"db"` Log LogConfig `mapstructure:"log"` // contains filtered or unexported fields }
func GetConfigEnvironment ¶
GetConfigEnvironment read config from environment variables and config.toml file
type DBConfig ¶
type DBConfig struct {
MySQL MySQLConfig `mapstructure:"mysql"`
}
type MySQLConfig ¶
type MySQLConfig struct { Username string `mapstructure:"username"` Password string `mapstructure:"password"` Host string `mapstructure:"host"` Port string `mapstructure:"port"` DBName string `mapstructure:"db-name"` MaxLifeInMinutes int `mapstructure:"max-life-in-minutes"` MaxIdleConnections int `mapstructure:"max-idle-connections"` MaxOpenConnections int `mapstructure:"max-open-connections"` }
Click to show internal directories.
Click to hide internal directories.