Documentation ¶
Index ¶
- Constants
- func HandleClientRestart(r clientFacade)
- func NewServiceDiscoveryClient(opts ...etcd.Option) *etcd.Client
- func ValidateClient(container clientFacade, opts ...etcd.Option) error
- type EventListener
- func (l *EventListener) Close()
- func (l *EventListener) ListenServiceEvent(key string, listener remoting.DataListener)
- func (l *EventListener) ListenServiceNodeEvent(key string, listener ...remoting.DataListener) bool
- func (l *EventListener) ListenServiceNodeEventWithPrefix(prefix string, listener ...remoting.DataListener)
Constants ¶
View Source
const ( // ConnDelay connection delay ConnDelay = 3 // MaxFailTimes max failure times MaxFailTimes = 15 )
Variables ¶
This section is empty.
Functions ¶
func HandleClientRestart ¶
func HandleClientRestart(r clientFacade)
HandleClientRestart keeps the connection between client and server
func NewServiceDiscoveryClient ¶ added in v1.5.0
func ValidateClient ¶
ValidateClient validates client and sets options
Types ¶
type EventListener ¶
type EventListener struct {
// contains filtered or unexported fields
}
nolint
func NewEventListener ¶
func NewEventListener(client *etcd.Client) *EventListener
NewEventListener returns a EventListener instance
func (*EventListener) Close ¶
func (l *EventListener) Close()
func (*EventListener) ListenServiceEvent ¶
func (l *EventListener) ListenServiceEvent(key string, listener remoting.DataListener)
ListenServiceEvent is invoked by etcdv3 ConsumerRegistry::Registe/ etcdv3 ConsumerRegistry::get/etcdv3 ConsumerRegistry::getListener registry.go:Listen -> listenServiceEvent -> listenDirEvent -> listenServiceNodeEvent
| --------> listenServiceNodeEvent
func (*EventListener) ListenServiceNodeEvent ¶
func (l *EventListener) ListenServiceNodeEvent(key string, listener ...remoting.DataListener) bool
ListenServiceNodeEvent Listen on a spec key this method will return true when spec key deleted, this method will return false when deep layer connection lose
func (*EventListener) ListenServiceNodeEventWithPrefix ¶
func (l *EventListener) ListenServiceNodeEventWithPrefix(prefix string, listener ...remoting.DataListener)
ListenServiceNodeEventWithPrefix listens on a set of key with spec prefix
Click to show internal directories.
Click to hide internal directories.