Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Delimiter is a separator that separates the etcd path.
Delimiter = '/'
)
Variables ¶
View Source
var ( // DialTimeout is the dial timeout. DialTimeout = dialTimeout // RequestTimeout is the request timeout. RequestTimeout = requestTimeout // NewClient is used to create etcd clients. NewClient = DialClient )
Functions ¶
This section is empty.
Types ¶
type DoneChan ¶
type DoneChan struct {
// contains filtered or unexported fields
}
A DoneChan is used as a channel that can be closed multiple times and wait for done.
func (*DoneChan) Close ¶
func (dc *DoneChan) Close()
Close closes dc, it's safe to close more than once.
func (*DoneChan) Done ¶
func (dc *DoneChan) Done() chan PlaceholderType
Done returns a channel that can be notified on dc closed.
type EtcdClient ¶
type EtcdClient interface { ActiveConnection() *grpc.ClientConn Close() error Ctx() context.Context Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantResponse, error) KeepAlive(ctx context.Context, id clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) Revoke(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan }
EtcdClient interface represents an etcd client.
func DialClient ¶
func DialClient(endpoints []string) (EtcdClient, error)
DialClient dials an etcd cluster with given endpoints.
type PlaceholderType ¶
type PlaceholderType = struct{}
PlaceholderType represents a placeholder type.
var Placeholder PlaceholderType
Placeholder is a placeholder object that can be used globally.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
A Registry is a registry that manages the etcd client connections.
type UpdateListener ¶
UpdateListener wraps the OnAdd and OnDelete methods.
Click to show internal directories.
Click to hide internal directories.