Documentation
¶
Index ¶
- type ClusterTSL
- type Config
- func (c *Config) GetAddress() string
- func (c *Config) GetConfigData() ConfigData
- func (c *Config) GetHttpVersion() string
- func (c *Config) GetTSL() *ClusterTSL
- func (c *Config) IsAuth() bool
- func (c *Config) IsHttp2() bool
- func (c *Config) IsHttps() bool
- func (c *Config) IsLog() bool
- func (c *Config) LoadConfigFile(path string) IConfig
- func (c *Config) ReloadConfigFile()
- func (c *Config) SetTSL(tsl *ClusterTSL) error
- type ConfigData
- type ConfigYaml
- func (c *ConfigYaml) GetAddress() string
- func (c *ConfigYaml) GetConfigData() ConfigData
- func (c *ConfigYaml) GetHttpVersion() string
- func (c *ConfigYaml) GetTSL() *ClusterTSL
- func (c *ConfigYaml) IsAuth() bool
- func (c *ConfigYaml) IsHttp2() bool
- func (c *ConfigYaml) IsHttps() bool
- func (c *ConfigYaml) IsLog() bool
- func (c *ConfigYaml) LoadConfigFile(path string) IConfig
- func (c *ConfigYaml) ReloadConfigFile()
- func (c *ConfigYaml) SetTSL(tsl *ClusterTSL) error
- type IConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterTSL ¶
type Config ¶
func (*Config) GetAddress ¶
func (*Config) GetConfigData ¶
func (c *Config) GetConfigData() ConfigData
func (*Config) GetHttpVersion ¶
func (*Config) GetTSL ¶
func (c *Config) GetTSL() *ClusterTSL
func (*Config) LoadConfigFile ¶
error code 1000 ~ 1200
func (*Config) SetTSL ¶
func (c *Config) SetTSL(tsl *ClusterTSL) error
type ConfigData ¶
type ConfigData struct {
Cluster struct {
Host string
Port int
Log bool // 日志记录
Auth bool // 鉴权
HttpVersion string `toml:"httpVersion",yaml:"httpVersion"` // 1.0, 1.1, 2.0
Openssl bool // https
TLS struct {
Cert string
Key string
}
}
Mysql struct {
Host string
Port int
Username string
Password string
Dbname string
Charset string
MaxOpenConns int `toml:"maxOpenConns",yaml:"maxOpenConns"`
}
Memcache struct {
Host string
Port int
}
Redis struct {
Host string
Port int
Timeout int
}
}
type ConfigYaml ¶
func (*ConfigYaml) GetAddress ¶
func (c *ConfigYaml) GetAddress() string
func (*ConfigYaml) GetConfigData ¶
func (c *ConfigYaml) GetConfigData() ConfigData
func (*ConfigYaml) GetHttpVersion ¶
func (c *ConfigYaml) GetHttpVersion() string
func (*ConfigYaml) GetTSL ¶
func (c *ConfigYaml) GetTSL() *ClusterTSL
func (*ConfigYaml) IsAuth ¶
func (c *ConfigYaml) IsAuth() bool
func (*ConfigYaml) IsHttp2 ¶
func (c *ConfigYaml) IsHttp2() bool
func (*ConfigYaml) IsHttps ¶
func (c *ConfigYaml) IsHttps() bool
func (*ConfigYaml) IsLog ¶
func (c *ConfigYaml) IsLog() bool
func (*ConfigYaml) LoadConfigFile ¶
func (c *ConfigYaml) LoadConfigFile(path string) IConfig
func (*ConfigYaml) SetTSL ¶
func (c *ConfigYaml) SetTSL(tsl *ClusterTSL) error
type IConfig ¶
type IConfig interface {
LoadConfigFile(path string) IConfig
ReloadConfigFile()
SetTSL(tsl *ClusterTSL) error
GetTSL() *ClusterTSL
GetAddress() string
IsHttps() bool // 是否开启https
IsLog() bool
IsAuth() bool // 是否开启鉴权
IsHttp2() bool
GetHttpVersion() string
GetConfigData() ConfigData
}
func NewConfigYaml ¶
func NewConfigYaml() IConfig
Click to show internal directories.
Click to hide internal directories.