Documentation ¶
Index ¶
- Variables
- type Etcd
- func (e *Etcd) Close() error
- func (e *Etcd) DelKey(ctx context.Context, key string) error
- func (e *Etcd) Get(ctx context.Context, key string) (value []byte, err error)
- func (e *Etcd) GetWithPrefixKey(ctx context.Context, prefix string) ([]string, []string, error)
- func (e *Etcd) GrantLease(ttl int64) (clientv3.LeaseID, error)
- func (e *Etcd) InsertKV(ctx context.Context, key, val string, leaseID clientv3.LeaseID) error
- func (e *Etcd) InsertKVNoExisted(ctx context.Context, key, val string, leaseID clientv3.LeaseID) error
- func (e *Etcd) KeepaliveWithTTL(ctx context.Context, key, value string, ttl int64) error
- func (e *Etcd) RenewLease(ctx context.Context, id clientv3.LeaseID) error
- func (e *Etcd) RevokeLease(id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error)
- func (e *Etcd) TryLockWithTTL(key string, ttl int64) error
- func (e *Etcd) WatchWithPrefix(key string, cb func(*clientv3.Event) error) error
- type EtcdConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyAlreadyExists = fmt.Errorf("ErrKeyAlreadyExists") ErrEtcdLeaseNotFound = fmt.Errorf("ErrEtcdLeaseNotFound") )
Functions ¶
This section is empty.
Types ¶
type Etcd ¶
type Etcd struct {
// contains filtered or unexported fields
}
func NewEtcd ¶
func NewEtcd(config *EtcdConfig) *Etcd
func (*Etcd) GetWithPrefixKey ¶
func (*Etcd) InsertKVNoExisted ¶
func (*Etcd) KeepaliveWithTTL ¶
func (*Etcd) RevokeLease ¶
type EtcdConfig ¶
Click to show internal directories.
Click to hide internal directories.