Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DB = &DBConfig{}
DB is the mysql config instance
var GRPC = &GRPCConfig{}
GRPC is the grpc config instance
var HTTP = &HTTPConfig{}
HTTP is the http config instance
var Main = &MainConfig{}
Main is the log config instance
var Profiling = &ProfilingConfig{}
Profiling is the profiling config instance
var Redis = &RedisConfig{Config: &rdb.Config{}}
Redis is the redis config instance
Functions ¶
Types ¶
type Config ¶
type Config interface { // SectionName return the section name SectionName() string // Load load the config in the section specified in `SectionName()` Load(*ini.Section) error }
Config defines the config interface
type DBConfig ¶
type DBConfig struct { DataSource string MaxIdleConns int MaxOpenConns int ConnMaxLifetime time.Duration }
DBConfig defines the mysql config
func (*DBConfig) SectionName ¶
SectionName implements the `Config.SectionName()` method
type GRPCConfig ¶ added in v1.2.0
type GRPCConfig struct { Addr string LogFile string LogSampler LogSamplerConfig }
GRPCConfig defines the grpc config
func (*GRPCConfig) Load ¶ added in v1.2.0
func (conf *GRPCConfig) Load(section *ini.Section) error
Load implements the `Config.Load()` method
func (*GRPCConfig) SectionName ¶ added in v1.2.0
func (conf *GRPCConfig) SectionName() string
SectionName implements the `Config.SectionName()` method
type HTTPConfig ¶
type HTTPConfig struct { Addr string ReadTimeout time.Duration WriteTimeout time.Duration MaxHeaderBytes int MaxBodyBytes int64 LogFile string LogSampler LogSamplerConfig }
HTTPConfig defines the HTTP config
func (*HTTPConfig) Load ¶
func (conf *HTTPConfig) Load(section *ini.Section) error
Load implements the `Config.Load()` method
func (*HTTPConfig) SectionName ¶
func (conf *HTTPConfig) SectionName() string
SectionName implements the `Config.SectionName()` method
type LogSamplerConfig ¶ added in v1.2.0
type MainConfig ¶
MainConfig defines the Main config
func (*MainConfig) Load ¶
func (conf *MainConfig) Load(section *ini.Section) error
Load implements the `Config.Load()` method
func (*MainConfig) SectionName ¶
func (conf *MainConfig) SectionName() string
SectionName implements the `Config.SectionName()` method
type ProfilingConfig ¶
ProfilingConfig defines the profiling config
func (*ProfilingConfig) Load ¶
func (conf *ProfilingConfig) Load(section *ini.Section) error
Load implements the `Config.Load()` method
func (*ProfilingConfig) SectionName ¶
func (conf *ProfilingConfig) SectionName() string
SectionName implements the `Config.SectionName()` method
type RedisConfig ¶
Config defines the redis config
func (*RedisConfig) Load ¶
func (conf *RedisConfig) Load(section *ini.Section) error
Load implements the `Config.Load()` method
func (*RedisConfig) SectionName ¶
func (conf *RedisConfig) SectionName() string
SectionName implements the `Config.SectionName()` method