Documentation ¶
Index ¶
- Variables
- func NewETCDClient(etcdConfig *EtcdConfig) (*v3.Client, error)
- func WaitEvents(c *clientv3.Client, key string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error)
- func WaitPrefixEvents(ctx context.Context, c *clientv3.Client, prefix string, rev int64, ...) (*clientv3.Event, error)
- type EphemeralKV
- type EtcdConfig
- type Queue
- func (q *Queue) CancelWatch()
- func (q *Queue) DeleteKey(key string) error
- func (q *Queue) DeleteKeyWithRevision(key string, revision int64) (bool, error)
- func (q *Queue) Dequeue() (string, error)
- func (q *Queue) DequeueFirstKey() (string, error)
- func (q *Queue) Enqueue(val string) error
- func (q *Queue) EnqueueReturnKey(val string) (string, error)
- func (q *Queue) GetAllKeys() (map[string]string, error)
- func (q *Queue) GetFirstKey() (string, string, error)
- func (q *Queue) GetKey(key string) (string, error)
- func (q *Queue) GetKeyAndRevision(key string) (string, int64, error)
- func (q *Queue) GetLastKey() (string, string, error)
- func (q *Queue) UpdateKey(key, value string) error
- func (q *Queue) UpdateKeyWithRevison(key, value string, revision int64) (bool, error)
- type RemoteKV
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewETCDClient ¶
func NewETCDClient(etcdConfig *EtcdConfig) (*v3.Client, error)
NewETCDClient new etcd client v3
Types ¶
type EphemeralKV ¶
type EphemeralKV struct{ RemoteKV }
EphemeralKV is a new key associated with a session lease
type EtcdConfig ¶
type EtcdConfig struct { Endpoints string // args for clientv3.Config DialTimeout time.Duration // args for clientv3.Config AutoSyncInterval time.Duration // args for clientv3.Config CaFile string // args for clientv3.Config.TLS CertFile string // args for clientv3.Config.TLS KeyFile string // args for clientv3.Config.TLS }
EtcdConfig etcd client arguments
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue implements a multi-reader, multi-writer distributed queue.
func NewEtcdQueue ¶
func NewEtcdQueue(etcdConfig *EtcdConfig, keyPrefix string) (*Queue, error)
NewEtcdQueue new a etcd queue
func (*Queue) DeleteKeyWithRevision ¶
Delete key with revision
func (*Queue) Dequeue ¶
Dequeue returns Enqueue()'d elements in FIFO order. If the queue is empty, Dequeue blocks until elements are available.
func (*Queue) EnqueueReturnKey ¶
Enqueue key
func (*Queue) GetFirstKey ¶
returns key string value string error
func (*Queue) GetKeyAndRevision ¶
Get key and revision
func (*Queue) GetLastKey ¶
returns key string value string error
Click to show internal directories.
Click to hide internal directories.