Documentation
¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_DB_MAX_IDLE_CONNS = 1024 DEFAULT_DB_MAX_OPEN_CONNS = 1024 DEFAULT_GC_CHECK_TIME = 5 )
View Source
const (
CFG_SUFFIX = "toml"
)
Variables ¶
This section is empty.
Functions ¶
func ReadConfigs ¶
func ReadConfigs(dir string, funcConfigParse FuncConfigParse) error
Types ¶
type CacheConfig ¶
type CacheConfig struct {
Mode int
Nodes []string
Master string
Address string
Password string
ConnectionTimeout int
ReadTimeout int
WriteTimeout int
KeepAlive int
PoolMaxIdle int
PoolIdleTimeout int
}
func (*CacheConfig) Parse ¶
func (cc *CacheConfig) Parse(vals map[string]interface{}) error
type CommonConfig ¶
type CommonConfig struct {
Log LogConfig
Cache CacheConfig
}
func ReadCommonConfig ¶
func ReadCommonConfig(dir string) (*CommonConfig, error)
func (*CommonConfig) Parse ¶
func (cc *CommonConfig) Parse() error
type Config ¶
type Config struct {
Endpoint EndpointConfig
Log LogConfig
StorageCfg StorageConfig
Database DatabaseConfig
}
type ConfigWatcher ¶
type ConfigWatcher struct {
FuncConfigParse FuncConfigParse
// contains filtered or unexported fields
}
func NewConfigWatcher ¶
func NewConfigWatcher(funcConfigParse FuncConfigParse) (*ConfigWatcher, error)
func (*ConfigWatcher) Error ¶
func (cw *ConfigWatcher) Error() error
func (*ConfigWatcher) Stop ¶
func (cw *ConfigWatcher) Stop()
func (*ConfigWatcher) Watch ¶
func (cw *ConfigWatcher) Watch(dir string)
type DatabaseConfig ¶
type DatabaseConfig struct {
DbType string
DbUrl string
DbPassword string
MaxIdleConns int
MaxOpenConns int
}
func (*DatabaseConfig) Parse ¶
func (dc *DatabaseConfig) Parse(vals map[string]interface{}) error
type EndpointConfig ¶
type EndpointConfig struct {
Url string
MachineId int
// how frequency to perform a gc in seconds.
GcCheckTime int64
}
func (*EndpointConfig) Parse ¶
func (ec *EndpointConfig) Parse(vals map[string]interface{}) error
type FuncConfigParse ¶
type StorageConfig ¶
type StorageConfig struct {
CephPath string
}
func (*StorageConfig) Parse ¶
func (sc *StorageConfig) Parse(vals map[string]interface{}) error
Click to show internal directories.
Click to hide internal directories.