Documentation ¶
Index ¶
- Variables
- type Discovery
- func NewDiscovery(basePath string, servicePath string, redisAddr []string, options *store.Config) (*Discovery, error)
- func NewDiscoveryStore(basePath string, kv store.Store) (*Discovery, error)
- func NewRedisDiscoveryTemplate(basePath string, redisAddr []string, options *store.Config) (*Discovery, error)
- func (d *Discovery) Clone(servicePath string) (client.ServiceDiscovery, error)
- func (d *Discovery) Close()
- func (d *Discovery) GetServices() []*client.KVPair
- func (d *Discovery) RemoveWatcher(ch chan []*client.KVPair)
- func (d *Discovery) SetFilter(filter client.ServiceDiscoveryFilter)
- func (d *Discovery) WatchService() chan []*client.KVPair
- type Register
- func (p *Register) HandleConnAccept(conn net.Conn) (net.Conn, bool)
- func (p *Register) PreCall(_ context.Context, _, _ string, args interface{}) (interface{}, error)
- func (p *Register) Register(name string, rcvr interface{}, metadata string) (err error)
- func (p *Register) Start() error
- func (p *Register) Stop() error
- func (p *Register) Unregister(name string) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var AllowKeyNotFound bool = true
Functions ¶
This section is empty.
Types ¶
type Discovery ¶ added in v0.0.6
type Discovery struct { // -1 means it always retry to watch until zookeeper is ok, 0 means no retry. RetriesAfterWatchFailed int // contains filtered or unexported fields }
Discovery is a redis service discovery. It always returns the registered servers in redis.
func NewDiscovery ¶ added in v0.0.6
func NewDiscovery(basePath string, servicePath string, redisAddr []string, options *store.Config) (*Discovery, error)
NewDiscovery returns a new Discovery.
func NewDiscoveryStore ¶ added in v0.0.6
NewDiscoveryStore return a new Discovery with specified store.
func NewRedisDiscoveryTemplate ¶
func NewRedisDiscoveryTemplate(basePath string, redisAddr []string, options *store.Config) (*Discovery, error)
NewRedisDiscoveryTemplate returns a new Discovery template.
func (*Discovery) Clone ¶ added in v0.0.6
func (d *Discovery) Clone(servicePath string) (client.ServiceDiscovery, error)
Clone clones this ServiceDiscovery with new servicePath.
func (*Discovery) GetServices ¶ added in v0.0.6
GetServices returns the servers
func (*Discovery) RemoveWatcher ¶ added in v0.0.6
func (*Discovery) SetFilter ¶ added in v0.0.6
func (d *Discovery) SetFilter(filter client.ServiceDiscoveryFilter)
SetFilter sets the filer.
func (*Discovery) WatchService ¶ added in v0.0.6
WatchService returns a nil chan.
type Register ¶ added in v0.0.6
type Register struct { // service address, for example, tcp@127.0.0.1:8972, quic@127.0.0.1:1234 ServiceAddress string // redis addresses RedisServers []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 }
Register implements redis registry.
func (*Register) HandleConnAccept ¶ added in v0.0.6
HandleConnAccept handles connections from clients
func (*Register) Register ¶ added in v0.0.6
Register handles registering event. this service is registered at BASE/serviceName/thisIpAddress node
func (*Register) Unregister ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.