Documentation ¶
Index ¶
- type ConsulRegisterPlugin
- func (plugin *ConsulRegisterPlugin) CheckFail(name string)
- func (plugin *ConsulRegisterPlugin) CheckPass(name string)
- func (plugin *ConsulRegisterPlugin) Close()
- func (plugin *ConsulRegisterPlugin) Description() string
- func (plugin *ConsulRegisterPlugin) FindServices(name string) []*api.AgentService
- func (plugin *ConsulRegisterPlugin) Name() string
- func (plugin *ConsulRegisterPlugin) Register(name string, rcvr interface{}, metadata ...string) (err error)
- func (plugin *ConsulRegisterPlugin) Start() (err error)
- func (plugin *ConsulRegisterPlugin) Unregister(name string)
- type EtcdRegisterPlugin
- func (plugin *EtcdRegisterPlugin) Close()
- func (plugin *EtcdRegisterPlugin) Description() string
- func (plugin *EtcdRegisterPlugin) HandleConnAccept(net.Conn) bool
- func (plugin *EtcdRegisterPlugin) Name() string
- func (plugin *EtcdRegisterPlugin) Register(name string, rcvr interface{}, metadata ...string) (err error)
- func (plugin *EtcdRegisterPlugin) Start() (err error)
- func (plugin *EtcdRegisterPlugin) Unregister(name string)
- type LogRegisterPlugin
- type MetricsPlugin
- func (plugin *MetricsPlugin) Description() string
- func (plugin *MetricsPlugin) HandleConnAccept(net.Conn) bool
- func (plugin *MetricsPlugin) Name() string
- func (plugin *MetricsPlugin) PostReadRequestHeader(r *rpc.Request) error
- func (plugin *MetricsPlugin) PostWriteResponse(r *rpc.Response, body interface{}) error
- func (plugin *MetricsPlugin) PreReadRequestHeader(r *rpc.Request) error
- func (plugin *MetricsPlugin) Register(name string, rcvr interface{}, metadata ...string) error
- type RateLimitingPlugin
- type ZooKeeperRegisterPlugin
- func (plugin *ZooKeeperRegisterPlugin) Close()
- func (plugin *ZooKeeperRegisterPlugin) Description() string
- func (plugin *ZooKeeperRegisterPlugin) HandleConnAccept(net.Conn) bool
- func (plugin *ZooKeeperRegisterPlugin) Name() string
- func (plugin *ZooKeeperRegisterPlugin) Register(name string, rcvr interface{}, metadata ...string) (err error)
- func (plugin *ZooKeeperRegisterPlugin) Start() (err error)
- func (plugin *ZooKeeperRegisterPlugin) Unregister(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulRegisterPlugin ¶
type ConsulRegisterPlugin struct { ServiceAddress string ConsulAddress string Services []string // contains filtered or unexported fields }
ConsulRegisterPlugin a register plugin which can register services into consul for cluster This registry is experimental and has not been test.
func (*ConsulRegisterPlugin) CheckFail ¶
func (plugin *ConsulRegisterPlugin) CheckFail(name string)
CheckFail sets check fail
func (*ConsulRegisterPlugin) CheckPass ¶
func (plugin *ConsulRegisterPlugin) CheckPass(name string)
CheckPass sets check pass
func (*ConsulRegisterPlugin) Close ¶
func (plugin *ConsulRegisterPlugin) Close()
Close closes this plugin
func (*ConsulRegisterPlugin) Description ¶
func (plugin *ConsulRegisterPlugin) Description() string
Description return description of this plugin.
func (*ConsulRegisterPlugin) FindServices ¶
func (plugin *ConsulRegisterPlugin) FindServices(name string) []*api.AgentService
FindServices gets a service list by name
func (*ConsulRegisterPlugin) Name ¶
func (plugin *ConsulRegisterPlugin) Name() string
Name return name of this plugin.
func (*ConsulRegisterPlugin) Register ¶
func (plugin *ConsulRegisterPlugin) Register(name string, rcvr interface{}, metadata ...string) (err error)
Register handles registering event.
func (*ConsulRegisterPlugin) Start ¶
func (plugin *ConsulRegisterPlugin) Start() (err error)
Start starts to connect etcd cluster
func (*ConsulRegisterPlugin) Unregister ¶
func (plugin *ConsulRegisterPlugin) Unregister(name string)
Unregister a service from consul but this service still exists in this node.
type EtcdRegisterPlugin ¶
type EtcdRegisterPlugin struct { ServiceAddress string EtcdServers []string BasePath string Metrics metrics.Registry Services []string UpdateInterval time.Duration KeysAPI client.KeysAPI // contains filtered or unexported fields }
EtcdRegisterPlugin a register plugin which can register services into etcd for cluster
func (*EtcdRegisterPlugin) Close ¶
func (plugin *EtcdRegisterPlugin) Close()
Close closes this plugin
func (*EtcdRegisterPlugin) Description ¶
func (plugin *EtcdRegisterPlugin) Description() string
Description return description of this plugin.
func (*EtcdRegisterPlugin) HandleConnAccept ¶
func (plugin *EtcdRegisterPlugin) HandleConnAccept(net.Conn) bool
HandleConnAccept handles connections from clients
func (*EtcdRegisterPlugin) Name ¶
func (plugin *EtcdRegisterPlugin) Name() string
Name return name of this plugin.
func (*EtcdRegisterPlugin) Register ¶
func (plugin *EtcdRegisterPlugin) Register(name string, rcvr interface{}, metadata ...string) (err error)
Register handles registering event. this service is registered at BASE/serviceName/thisIpAddress node
func (*EtcdRegisterPlugin) Start ¶
func (plugin *EtcdRegisterPlugin) Start() (err error)
Start starts to connect etcd cluster
func (*EtcdRegisterPlugin) Unregister ¶
func (plugin *EtcdRegisterPlugin) Unregister(name string)
Unregister a service from zookeeper but this service still exists in this node.
type LogRegisterPlugin ¶
type LogRegisterPlugin struct {
Log func(log string)
}
LogRegisterPlugin is a register plugin which can log registered services in logs
func (*LogRegisterPlugin) Description ¶
func (plugin *LogRegisterPlugin) Description() string
Description return description of this plugin.
func (*LogRegisterPlugin) Name ¶
func (plugin *LogRegisterPlugin) Name() string
Name return name of this plugin.
type MetricsPlugin ¶
type MetricsPlugin struct { Registry metrics.Registry // contains filtered or unexported fields }
MetricsPlugin collects metrics of a rpc server
func NewMetricsPlugin ¶
func NewMetricsPlugin() *MetricsPlugin
NewMetricsPlugin creates a new MetricsPlugirn
func (*MetricsPlugin) Description ¶
func (plugin *MetricsPlugin) Description() string
Description return description of this plugin.
func (*MetricsPlugin) HandleConnAccept ¶
func (plugin *MetricsPlugin) HandleConnAccept(net.Conn) bool
HandleConnAccept handles connections from clients
func (*MetricsPlugin) Name ¶
func (plugin *MetricsPlugin) Name() string
Name return name of this plugin.
func (*MetricsPlugin) PostReadRequestHeader ¶
func (plugin *MetricsPlugin) PostReadRequestHeader(r *rpc.Request) error
PostReadRequestHeader counts read
func (*MetricsPlugin) PostWriteResponse ¶
func (plugin *MetricsPlugin) PostWriteResponse(r *rpc.Response, body interface{}) error
PostWriteResponse count write
func (*MetricsPlugin) PreReadRequestHeader ¶
func (plugin *MetricsPlugin) PreReadRequestHeader(r *rpc.Request) error
PreReadRequestHeader marks start time of calling service
type RateLimitingPlugin ¶
type RateLimitingPlugin struct { FillInterval time.Duration Capacity int64 // contains filtered or unexported fields }
RateLimitingPlugin can limit connecting per unit time
func NewRateLimitingPlugin ¶
func NewRateLimitingPlugin(fillInterval time.Duration, capacity int64) *RateLimitingPlugin
NewRateLimitingPlugin creates a NewRateLimitingPlugin
func (*RateLimitingPlugin) Description ¶ added in v1.1.1
func (plugin *RateLimitingPlugin) Description() string
Description return description of this plugin.
func (*RateLimitingPlugin) HandleConnAccept ¶
func (plugin *RateLimitingPlugin) HandleConnAccept(conn net.Conn) bool
HandleConnAccept can limit connecting rate
func (*RateLimitingPlugin) Name ¶ added in v1.1.1
func (plugin *RateLimitingPlugin) Name() string
Name return name of this plugin.
type ZooKeeperRegisterPlugin ¶
type ZooKeeperRegisterPlugin struct { ServiceAddress string ZooKeeperServers []string BasePath string Conn *zk.Conn Metrics metrics.Registry Services []string UpdateInterval time.Duration }
ZooKeeperRegisterPlugin a register plugin which can register services into zookeeper for cluster
func (*ZooKeeperRegisterPlugin) Close ¶
func (plugin *ZooKeeperRegisterPlugin) Close()
Close closes zookeeper connection.
func (*ZooKeeperRegisterPlugin) Description ¶
func (plugin *ZooKeeperRegisterPlugin) Description() string
Description return description of this plugin.
func (*ZooKeeperRegisterPlugin) HandleConnAccept ¶
func (plugin *ZooKeeperRegisterPlugin) HandleConnAccept(net.Conn) bool
HandleConnAccept handles connections from clients
func (*ZooKeeperRegisterPlugin) Name ¶
func (plugin *ZooKeeperRegisterPlugin) Name() string
Name return name of this plugin.
func (*ZooKeeperRegisterPlugin) Register ¶
func (plugin *ZooKeeperRegisterPlugin) Register(name string, rcvr interface{}, metadata ...string) (err error)
Register handles registering event. this service is registered at BASE/serviceName/thisIpAddress node
func (*ZooKeeperRegisterPlugin) Start ¶
func (plugin *ZooKeeperRegisterPlugin) Start() (err error)
Start starts to connect zookeeper cluster
func (*ZooKeeperRegisterPlugin) Unregister ¶
func (plugin *ZooKeeperRegisterPlugin) Unregister(name string)
Unregister a service from zookeeper but this service still exists in this node.