Documentation ¶
Index ¶
- func DecryptSecretValue(value string) (string, error)
- type AppConfig
- type Config
- type CronConfig
- type CronJobConfig
- type DbConfig
- type ExtConfig
- type GraceTerminationConfig
- type LogConfig
- type MetricsConfig
- type RPCClientConfig
- type RPCConfig
- type RedisClusterConfig
- type RedisConfig
- type RedisSentinelConfig
- type SecretsConfig
- type SwaggerConfig
- type WebConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptSecretValue ¶
Types ¶
type AppConfig ¶
type AppConfig struct { Group string `yaml:"group"` Name string `yaml:"name"` Profile string `yaml:"profile"` GOMAXPROCS int `yaml:"goMaxProcs"` Ext ExtConfig `yaml:"ext"` GraceTermination *GraceTerminationConfig `yaml:"graceTermination"` }
AppConfig -
type Config ¶
type Config struct { App *AppConfig `yaml:"app"` Log *LogConfig `yaml:"log"` DB *DbConfig `yaml:"db"` Redis *RedisConfig `yaml:"redis"` Web *WebConfig `yaml:"web"` RPC *RPCConfig `yaml:"rpc"` CronConfig *CronConfig `yaml:"cron"` Metrics *MetricsConfig `yaml:"metrics"` }
Config data
func MustLoadConfigCustom ¶
func MustLoadConfigCustom(confPath string, customConfig interface{ SetConfig(config *Config) }) *Config
MustLoadConfigCustom -
func MustNewConfigCustom ¶
MustNewConfigCustom -
type CronConfig ¶
type CronConfig struct { SkipIfStillRunning *bool `yaml:"skipIfStillRunning"` CronJobs []*CronJobConfig `yaml:"cronJobs"` }
CronConfig -
type CronJobConfig ¶
CronJobConfig -
type DbConfig ¶
type DbConfig struct { Username string `yaml:"username"` Password string `yaml:"password"` Host string `yaml:"host"` Port int32 `yaml:"port"` Database string `yaml:"database"` Charset string `yaml:"charset"` MaxIdle int32 `yaml:"maxIdle"` MaxIdleTime time.Duration `yaml:"maxIdleTime"` MaxOpen int32 `yaml:"maxOpen"` MaxLifetime time.Duration `yaml:"maxLifetime"` SlowQueryThreshold time.Duration `yaml:"slowQueryThreshold"` SkipDefaultTransaction *bool `yaml:"skipDefaultTransaction"` PrepareStmt *bool `yaml:"prepareStmt"` }
DbConfig -
type GraceTerminationConfig ¶
type GraceTerminationConfig struct {
GraceTerminationPeriod time.Duration `yaml:"graceTerminationPeriod"`
}
GraceTerminationConfig -
func (*GraceTerminationConfig) SetDefaultValues ¶
func (conf *GraceTerminationConfig) SetDefaultValues()
SetDefaultValues -
type LogConfig ¶
type LogConfig struct { Level string `yaml:"level"` Format string `yaml:"format"` PrettyPrint bool `yaml:"prettyPrint"` CallerPrint bool `yaml:"callerPrint"` TimestampFormat string `yaml:"timestampFormat"` LogPath string `yaml:"logPath"` LogFilename string `yaml:"logFilename"` }
LogConfig -
type MetricsConfig ¶
type MetricsConfig struct { Host string `yaml:"host"` Port int32 `yaml:"port"` MetricsPath string `yaml:"metricsPath"` BuildInfoCollector *bool `yaml:"buildInfoCollector"` ProcessCollector *bool `yaml:"processCollector"` GoCollector *bool `yaml:"goCollector"` }
MetricsConfig -
func (*MetricsConfig) SetDefaultValues ¶
func (conf *MetricsConfig) SetDefaultValues()
SetDefaultValues -
type RPCClientConfig ¶
type RPCClientConfig struct { Addr string `yaml:"addr"` Plaintext *bool `yaml:"plaintext"` InsecureSkipVerify bool `yaml:"insecureSkipVerify"` MaxCallSendMsgSize int `yaml:"maxCallSendMsgSize"` MaxCallRecvMsgSize int `yaml:"maxCallRecvMsgSize"` }
RPCClientConfig -
func (*RPCClientConfig) SetDefaultValues ¶
func (conf *RPCClientConfig) SetDefaultValues()
SetDefaultValues -
type RPCConfig ¶
type RPCConfig struct { Host string `yaml:"host"` Port int32 `yaml:"port"` MaxRecvMsgSize int64 `yaml:"maxRecvMsgSize"` RegisterHealthServer *bool `yaml:"registerHealthServer"` RegisterReflectionServer *bool `yaml:"registerReflectionServer"` Clients map[string]*RPCClientConfig `yaml:"clients"` }
RPCConfig -
type RedisClusterConfig ¶
type RedisClusterConfig struct { // Addrs - A list of "host:port" pairs to bootstrap from. This represents an "initial" list of cluster nodes and is required to have at least one entry. Addrs []string `yaml:"addrs"` // MaxRedirects -Maximum number of redirects to follow when executing commands across the cluster. MaxRedirects int32 `yaml:"maxRedirects"` }
RedisClusterConfig -
type RedisConfig ¶
type RedisConfig struct { Password string `yaml:"password"` Host string `yaml:"host"` Port int32 `yaml:"port"` Database uint8 `yaml:"database"` IdleTimeout time.Duration `yaml:"idleTimeout"` MaxConnLifetime time.Duration `yaml:"maxConnLifetime"` MaxIdle int32 `yaml:"maxIdle"` MaxActive int32 `yaml:"maxActive"` TestOnBorrow bool `yaml:"testOnBorrow"` Sentinel *RedisSentinelConfig `yaml:"sentinel"` Cluster *RedisClusterConfig `yaml:"cluster"` }
RedisConfig -
func (*RedisConfig) SetDefaultValues ¶
func (conf *RedisConfig) SetDefaultValues()
SetDefaultValues -
type RedisSentinelConfig ¶
type RedisSentinelConfig struct { // Master - MasterName is a name of Redis master Sentinel servers monitor(Name of the Redis server). Master string `yaml:"master"` // Addrs - Addrs is a slice of with known Sentinel addresses (A list of "host:port" pairs). Addrs []string `yaml:"addrs"` }
RedisSentinelConfig -
type SecretsConfig ¶
type SwaggerConfig ¶
SwaggerConfig -
type WebConfig ¶
type WebConfig struct { Host string `yaml:"host"` Port int32 `yaml:"port"` Swagger *SwaggerConfig `yaml:"swagger"` MaxMultipartMemory int64 `yaml:"maxMultipartMemory"` SensitiveURLPaths map[string]struct{} `yaml:"sensitiveURLPaths"` }
WebConfig -
func (*WebConfig) IsSensitiveURLPath ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.