Documentation
¶
Index ¶
- Variables
- type ClusterConfig
- type ClusterConnectionConfig
- type ClusterFailoverConfig
- type ClusterNodeConfig
- type Config
- func (cnf *Config) GetClusterConfig() *ClusterConfig
- func (cnf *Config) GetKafkaConfig() []*KafkaConfig
- func (cnf *Config) GetLimitConfig() *LimitConfig
- func (cnf *Config) GetLoginMPConfig() *MethodPathConfig
- func (cnf *Config) GetPluginConfigs() []*PluginConfig
- func (cnf *Config) GetRouteConfig() *RouteConfig
- func (cnf *Config) GetRouteHttpConfig() *RouteHttpConfig
- func (cnf *Config) GetWebsocketConfig() *WebsocketConfig
- func (cnf *Config) GetWhiteListConfig() []*MethodPathConfig
- func (cnf *Config) String() string
- type Duration
- type KafkaConfig
- type LimitConfig
- type MethodPathConfig
- type PluginConfig
- type RouteConfig
- type RouteHttpConfig
- type SchedulerConfig
- type WebsocketConfig
- type WsAutoCertConfig
- type WsTlsConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ConfFileNotFound = errors.New("config file not found")
)
Functions ¶
This section is empty.
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { Self string `toml:"self"` Connection *ClusterConnectionConfig `toml:"connection"` Nodes []*ClusterNodeConfig `toml:"nodes"` Failover *ClusterFailoverConfig `toml:"failover"` }
func (*ClusterConfig) String ¶
func (ccnf *ClusterConfig) String() string
type ClusterConnectionConfig ¶
type ClusterConnectionConfig struct { DialTimeout Duration `toml:"dial_timeout"` MaxDelay Duration `toml:"max_delay"` BaseDelay Duration `toml:"base_delay"` Factor float64 `toml:"factor"` Jitter float64 `toml:"jitter"` DisableReqTimeout bool `toml:"disable_request_timeout"` ReqWaitAfter Duration `toml:"request_wait_after"` }
func (*ClusterConnectionConfig) String ¶
func (ccc *ClusterConnectionConfig) String() string
type ClusterFailoverConfig ¶
type ClusterFailoverConfig struct { Enabled bool `toml:"enabled"` Heartbeat Duration `toml:"heartbeat"` VoteAfter int `toml:"vote_after"` NodeFailAfter int `toml:"node_fail_after"` }
func (*ClusterFailoverConfig) String ¶
func (cfc *ClusterFailoverConfig) String() string
type ClusterNodeConfig ¶
func (*ClusterNodeConfig) String ¶
func (cnc *ClusterNodeConfig) String() string
type Config ¶
type Config struct { WsCnf *WebsocketConfig `toml:"websocket"` ClusterCnf *ClusterConfig `toml:"cluster"` KafkaCnf []*KafkaConfig `toml:"kafkas"` PluginsCnf []*PluginConfig `toml:"plugins"` RouteCnf *RouteConfig `toml:"route""` RouteHttpCnf *RouteHttpConfig `toml:"routehttp"` SchedulerCnf *SchedulerConfig `toml:"scheduler"` LimitCnf *LimitConfig `toml:"limit"` LoginMPCnf *MethodPathConfig `toml:"login"` WhiteList []*MethodPathConfig `toml:"whiteList"` }
func Load ¶
Load 载入dolphin配置文件 1. 用户指定路径,如果传入的配置文件为空,则按照以下顺序查找配置文件 2. 查询应用程序同路径下是否存在配置文件 3. 查询$HOME/.config/dolphin.d/config.toml 4. 查询/etc/dolphin.d/config.toml
func (*Config) GetClusterConfig ¶
func (cnf *Config) GetClusterConfig() *ClusterConfig
func (*Config) GetKafkaConfig ¶
func (cnf *Config) GetKafkaConfig() []*KafkaConfig
func (*Config) GetLimitConfig ¶
func (cnf *Config) GetLimitConfig() *LimitConfig
func (*Config) GetLoginMPConfig ¶
func (cnf *Config) GetLoginMPConfig() *MethodPathConfig
func (*Config) GetPluginConfigs ¶
func (cnf *Config) GetPluginConfigs() []*PluginConfig
func (*Config) GetRouteConfig ¶
func (cnf *Config) GetRouteConfig() *RouteConfig
func (*Config) GetRouteHttpConfig ¶
func (cnf *Config) GetRouteHttpConfig() *RouteHttpConfig
func (*Config) GetWebsocketConfig ¶
func (cnf *Config) GetWebsocketConfig() *WebsocketConfig
func (*Config) GetWhiteListConfig ¶
func (cnf *Config) GetWhiteListConfig() []*MethodPathConfig
type Duration ¶
func (*Duration) UnmarshalText ¶
type KafkaConfig ¶
type KafkaConfig struct { Brokers []string `toml:"brokers"` Topic string `toml:"topic"` Offset int64 `toml:"offset"` GroupID string `toml:"groupId"` Partition int `toml:"partition"` MinBytes int `toml:"minBytes"` MaxBytes int `toml:"maxBytes"` MaxWait Duration `toml:"maxWait"` }
func (*KafkaConfig) String ¶
func (kcnf *KafkaConfig) String() string
type LimitConfig ¶
type MethodPathConfig ¶
type PluginConfig ¶
type PluginConfig struct { Enabled bool `toml:"enabled"` Name string `toml:"name"` ServerAddr string `toml:"server_addr"` }
func (*PluginConfig) String ¶
func (pcnf *PluginConfig) String() string
type RouteConfig ¶
type RouteHttpConfig ¶
type RouteHttpConfig struct {
Address string `toml:"address"`
}
type SchedulerConfig ¶
type SchedulerConfig struct {
Address string `toml:"address"`
}
type WebsocketConfig ¶
type WebsocketConfig struct { //监听端口号 Listen string `toml:"listen"` //读取缓冲区大小设置 ReadBufSize int `toml:"read_buf_size"` //写缓冲区大小设置 WriteBufSize int `toml:"write_buf_size"` //tls配置,证书路径等 Tls *WsTlsConfig `toml:"tls"` //写数据timeout WriteWait Duration `toml:"write_time_wait"` //读数据timeout ReadWait Duration `toml:"read_time_wait"` //空闲会话timeout IdleSessionTimeout Duration `toml:"idle_session_timeout"` //写数据个数缓冲区限制 SessionQueueSize int `toml:"session_queue_size"` //写数据个数缓冲区消费等待时间 QueueOutTimeout Duration `toml:"queue_out_timeout"` //sess.guid 盐 IDSalt string `toml:"id_salt"` }
func (*WebsocketConfig) String ¶
func (wscnf *WebsocketConfig) String() string
type WsAutoCertConfig ¶
type WsAutoCertConfig struct { CertCache string `toml:"cert_cache"` Email string `toml:"email"` Domains []string `toml:"domains"` }
func (*WsAutoCertConfig) String ¶
func (acc *WsAutoCertConfig) String() string
type WsTlsConfig ¶
type WsTlsConfig struct { Enabled bool `toml:"enabled"` HTTPRedirect string `toml:"http_redirect"` CertFile string `toml:"cert_file"` KeyFile string `toml:"key_file"` Autocert *WsAutoCertConfig `toml:"autocert"` }
func (*WsTlsConfig) String ¶
func (tcnf *WsTlsConfig) String() string
Click to show internal directories.
Click to hide internal directories.