Documentation ¶
Index ¶
- func GetConfPath(path ...string) string
- func GetServerId() string
- func GetServerName() string
- func InitCfg(path ...string)
- func LoadFile(path string) ([]byte, error)
- type DBConfig
- type GlobalVal
- type LogConfig
- type ServerCfgMgr
- func (scm *ServerCfgMgr) GetDBCfg(key string) *DBConfig
- func (scm *ServerCfgMgr) GetLogCfg(logName string) *LogConfig
- func (scm *ServerCfgMgr) GetServerId() string
- func (scm *ServerCfgMgr) GetServerName() string
- func (scm *ServerCfgMgr) GetSrvCfg(key string) *ServerConfig
- func (scm *ServerCfgMgr) LoadConf(path ...string)
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfPath ¶
func GetServerId ¶
func GetServerId() string
func GetServerName ¶
func GetServerName() string
Types ¶
type DBConfig ¶
type GlobalVal ¶
type GlobalVal struct { MaxConnNum int MaxPacketSize int32 MaxQueueSize int32 HttpTimeout time.Duration PongWait time.Duration WriteWait time.Duration RedisIdleTimeout time.Duration }
func GetGlobalVal ¶
func GetGlobalVal() *GlobalVal
type LogConfig ¶
type LogConfig struct { LogLevel string `json:"logLevel"` LogPath string `json:"logPath"` LogFile string `json:"logFile"` MaxAge int `json:"maxAge"` //minute, -1 unlimited RotationTime int `json:"rotationTime"` //minute }
func GetDefaultLogConf ¶
func GetDefaultLogConf() *LogConfig
type ServerCfgMgr ¶
type ServerCfgMgr struct { ServerId string `json:"server_id"` ServerName string `json:"server_name"` Servers map[string]*ServerConfig `json:"servers"` Db map[string]*DBConfig `json:"db"` Log map[string]*LogConfig `json:"log"` // contains filtered or unexported fields }
func GetDefalutServerCfgMgr ¶
func GetDefalutServerCfgMgr() *ServerCfgMgr
func NewServerCfgMgr ¶
func NewServerCfgMgr() *ServerCfgMgr
func (*ServerCfgMgr) GetDBCfg ¶
func (scm *ServerCfgMgr) GetDBCfg(key string) *DBConfig
func (*ServerCfgMgr) GetLogCfg ¶
func (scm *ServerCfgMgr) GetLogCfg(logName string) *LogConfig
func (*ServerCfgMgr) GetServerId ¶
func (scm *ServerCfgMgr) GetServerId() string
func (*ServerCfgMgr) GetServerName ¶
func (scm *ServerCfgMgr) GetServerName() string
func (*ServerCfgMgr) GetSrvCfg ¶
func (scm *ServerCfgMgr) GetSrvCfg(key string) *ServerConfig
func (*ServerCfgMgr) LoadConf ¶
func (scm *ServerCfgMgr) LoadConf(path ...string)
type ServerConfig ¶
type ServerConfig struct { Name string `json:"name"` Host string `json:"host"` Port int `json:"port"` WebHost string `json:"webHost"` WebPort int `json:"webPort"` MaxConn int `json:"maxConn"` MaxPacketSize int `json:"maxPacketSize"` Remotes []string `json:"remotes"` HostList []string `json:"hostList"` Timeout int64 `json:"timeout"` Group string `json:"group"` WatchGroups []string `json:"watchGroups"` }
func GetSrvCfg ¶
func GetSrvCfg(srvName string) *ServerConfig
Click to show internal directories.
Click to hide internal directories.