Documentation
¶
Index ¶
- Constants
- Variables
- func HandleClientRestart(r clientFacade)
- func ValidateClient(container clientFacade, opts ...Option) error
- type Client
- func (c *Client) CleanKV() error
- func (c *Client) Close()
- func (c *Client) Create(k string, v string) error
- func (c *Client) Delete(k string) error
- func (c *Client) Done() <-chan struct{}
- func (c *Client) Get(k string) (string, error)
- func (c *Client) GetChildrenKVList(k string) ([]string, []string, error)
- func (c *Client) RegisterTemp(basePath string, node string) (string, error)
- func (c *Client) Valid() bool
- func (c *Client) Watch(k string) (clientv3.WatchChan, error)
- func (c *Client) WatchWithPrefix(prefix string) (clientv3.WatchChan, 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)
- type Option
- type Options
Constants ¶
View Source
const ( // ConnDelay connection dalay ConnDelay = 3 // MaxFailTimes max failure times MaxFailTimes = 15 // RegistryETCDV3Client client name RegistryETCDV3Client = "etcd registry" )
Variables ¶
View Source
var ( // ErrNilETCDV3Client ... ErrNilETCDV3Client = perrors.New("etcd raw client is nil") // full describe the ERR // ErrKVPairNotFound ... ErrKVPairNotFound = perrors.New("k/v pair not found") )
Functions ¶
func ValidateClient ¶
ValidateClient ...
Types ¶
type Client ¶
Client ...
func (*Client) GetChildrenKVList ¶
GetChildrenKVList ...
func (*Client) RegisterTemp ¶
RegisterTemp ...
type EventListener ¶
type EventListener struct {
// contains filtered or unexported fields
}
EventListener ...
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 Listen on a set of key with spec prefix
Click to show internal directories.
Click to hide internal directories.