Documentation
¶
Index ¶
- type ZooKeeperOpt
- func WithZKBasePath(basePath string) ZooKeeperOpt
- func WithZKMetrics(me metrics.Registry) ZooKeeperOpt
- func WithZKServersAddress(zkServers []string) ZooKeeperOpt
- func WithZKServiceAddress(serviceAddress string) ZooKeeperOpt
- func WithZkOptions(Options *store.Config) ZooKeeperOpt
- func WithZkUpdateInterval(updateInterval time.Duration) ZooKeeperOpt
- type ZooKeeperRegisterPlugin
- func (p *ZooKeeperRegisterPlugin) HandleConnAccept(conn net.Conn) (net.Conn, bool)
- func (p *ZooKeeperRegisterPlugin) PreCall(_ context.Context, _, _ string, args interface{}) (interface{}, error)
- func (p *ZooKeeperRegisterPlugin) Register(name string, rcvr interface{}, metadata string) (err error)
- func (p *ZooKeeperRegisterPlugin) RegisterFunction(serviceName, fname string, fn interface{}, metadata string) error
- func (p *ZooKeeperRegisterPlugin) Start() error
- func (p *ZooKeeperRegisterPlugin) Stop() error
- func (p *ZooKeeperRegisterPlugin) Unregister(name string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ZooKeeperOpt ¶
type ZooKeeperOpt func(o *ZooKeeperRegisterPlugin)
func WithZKBasePath ¶
func WithZKBasePath(basePath string) ZooKeeperOpt
func WithZKMetrics ¶
func WithZKMetrics(me metrics.Registry) ZooKeeperOpt
func WithZKServersAddress ¶
func WithZKServersAddress(zkServers []string) ZooKeeperOpt
func WithZKServiceAddress ¶
func WithZKServiceAddress(serviceAddress string) ZooKeeperOpt
func WithZkOptions ¶
func WithZkOptions(Options *store.Config) ZooKeeperOpt
func WithZkUpdateInterval ¶
func WithZkUpdateInterval(updateInterval time.Duration) ZooKeeperOpt
type ZooKeeperRegisterPlugin ¶
type ZooKeeperRegisterPlugin struct { // service address, for example, tcp@127.0.0.1:8972, quic@127.0.0.1:1234 ServiceAddress string // zookeeper addresses ZooKeeperServers []string // base path for rpcx server, for example com/example/rpcx BasePath string Metrics metrics.Registry // Registered services Services []string UpdateInterval time.Duration Options *store.Config // contains filtered or unexported fields }
ZooKeeperRegisterPlugin implements zookeeper registry.
func NewZooKeeperRegisterPlugin ¶
func NewZooKeeperRegisterPlugin(opts ...ZooKeeperOpt) *ZooKeeperRegisterPlugin
func (*ZooKeeperRegisterPlugin) HandleConnAccept ¶
HandleConnAccept handles connections from clients
func (*ZooKeeperRegisterPlugin) PreCall ¶
func (p *ZooKeeperRegisterPlugin) PreCall(_ context.Context, _, _ string, args interface{}) (interface{}, error)
PreCall handles rpc call from clients
func (*ZooKeeperRegisterPlugin) Register ¶
func (p *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) RegisterFunction ¶
func (p *ZooKeeperRegisterPlugin) RegisterFunction(serviceName, fname string, fn interface{}, metadata string) error
func (*ZooKeeperRegisterPlugin) Start ¶
func (p *ZooKeeperRegisterPlugin) Start() error
Start starts to connect zookeeper cluster
func (*ZooKeeperRegisterPlugin) Stop ¶
func (p *ZooKeeperRegisterPlugin) Stop() error
Stop unregister all services.
func (*ZooKeeperRegisterPlugin) Unregister ¶
func (p *ZooKeeperRegisterPlugin) Unregister(name string) (err error)
Click to show internal directories.
Click to hide internal directories.