Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(configFile *string)
Types ¶
type Config ¶
type Config struct {
JWT JWTConfig `yaml:"jwt"`
Server ServerConfig `yaml:"server"`
Database DatabaseConfig `yaml:"database"`
Redis RedisConfig `yaml:"redis"`
}
var Conf *Config
func (*Config) GetJWTPublicKey ¶
func (c *Config) GetJWTPublicKey() interface{}
func (*Config) GetJWTRefreshSigningKey ¶
func (c *Config) GetJWTRefreshSigningKey() interface{}
func (*Config) GetJWTSigningKey ¶
func (c *Config) GetJWTSigningKey() interface{}
func (*Config) GetServerAddress ¶ added in v0.0.2
type DatabaseConfig ¶
type DatabaseConfig struct {
Host string `yaml:"host" envconfig:"CSERVICE_DB_HOST"`
Port uint `yaml:"port" envconfig:"CSERVICE_DB_PORT"`
Username string `yaml:"username" envconfig:"CSERVICE_DB_USERNAME"`
Password string `yaml:"password" envconfig:"CSERVICE_DB_PASSWORD"`
Name string `yaml:"name" envconfig:"CSERVICE_DB_NAME"`
AutoMigration bool `yaml:"auto_migration" envconfig:"CSERVICE_DB_AUTOMIGRATION"`
}
type JWTConfig ¶
type JWTConfig struct {
SigningMethod string `yaml:"signing_method" envconfig:"CSERVICE_JWT_SIGNING_METHOD"`
SigningKey string `yaml:"signing_key" envconfig:"CSERVICE_JWT_SIGNING_KEY"`
PublicKey string `yaml:"public_key,omitempty" envconfig:"CSERVICE_JWT_PUBLIC_KEY"`
RefreshSigningKey string `yaml:"refresh_signing_key" envconfig:"CSERVICE_JWT_REFRESH_SIGNING_KEY"`
RefreshPublicKey string `yaml:"refresh_public_key,omitempty" envconfig:"CSERVICE_JWT_REFRESH_PUBLIC_KEY"`
}
type RedisConfig ¶
type RedisConfig struct {
Host string `yaml:"host" envconfig:"CSERVICE_REDIS_HOST"`
Port uint `yaml:"port" envconfig:"CSERVICE_REDIS_PORT"`
Password string `yaml:"password" envconfig:"CSERVICE_REDIS_PASSWORD"`
Database int `yaml:"database" envconfig:"CSERVICE_REDIS_DATABASE"`
EnableMultiLogout bool `yaml:"enable_multi_logout" envconfig:"CSERVICE_REDIS_ENABLE_MULTI_LOGOUT"`
}
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.