Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConfigServerFormat = errs.New("servers config format error") ErrExecutorHashNoNode = errs.New("executor hash no hit node") ErrExecutorClosed = errs.New("executor already closed") )
errors
View Source
var (
ErrProxyMoreMaxConns = errs.New("Proxy accept more than max connextions")
)
proxy errors
Functions ¶
func NewExecutor ¶ added in v1.3.2
func NewExecutor(cc *ClusterConfig) (c proto.Executor)
NewExecutor new a executor by cluster config.
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { Name string HashMethod string `toml:"hash_method"` HashDistribution string `toml:"hash_distribution"` HashTag string `toml:"hash_tag"` CacheType proto.CacheType `toml:"cache_type"` ListenProto string `toml:"listen_proto"` ListenAddr string `toml:"listen_addr"` RedisAuth string `toml:"redis_auth"` DialTimeout int `toml:"dial_timeout"` ReadTimeout int `toml:"read_timeout"` WriteTimeout int `toml:"write_timeout"` NodeConnections int32 `toml:"node_connections"` PingFailLimit int `toml:"ping_fail_limit"` PingAutoEject bool `toml:"ping_auto_eject"` Servers []string }
ClusterConfig cluster config.
func (*ClusterConfig) Validate ¶
func (cc *ClusterConfig) Validate() error
Validate validate config field value.
type ClusterConfigs ¶
type ClusterConfigs struct {
Clusters []*ClusterConfig
}
ClusterConfigs cluster configs.
func (*ClusterConfigs) LoadFromFile ¶
func (ccs *ClusterConfigs) LoadFromFile(path string) error
LoadFromFile load from file.
type Config ¶
type Config struct { Pprof string Debug bool Log string LogVL int `toml:"log_vl"` Proxy struct { ReadTimeout int `toml:"read_timeout"` WriteTimeout int `toml:"write_timeout"` MaxConnections int32 `toml:"max_connections"` UseMetrics bool `toml:"use_metrics"` } }
Config proxy config.
func (*Config) LoadFromFile ¶
LoadFromFile load from file.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handle conn.
func NewHandler ¶
NewHandler new a conn handler.
Click to show internal directories.
Click to hide internal directories.