client

package
v1.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_DIAL_TIMEOUT  = 3 * time.Second
	DEFAULT_READ_TIMEOUT  = 3 * time.Second
	DEFAULT_WRITE_TIMEOUT = 3 * time.Second
	DATA_TTL              = 1800
)
View Source
const DEFAULT_LOCK_TTL = 60
View Source
const LEASE_PREFIX = "/etcd4go-lease/#lease/_%s"
View Source
const LOCK_PREFIX = "/etcd4go-lock/#lock/_%s"

Variables

View Source
var EtcdClient = etcdClient{}
View Source
var LockByOther = lockError{"lock by other"}
View Source
var LockError = lockError{"lock error"}
View Source
var NotFoundKeyError = etcdError{"NotFoundKey"}
View Source
var SortMode = sortMode{}

Functions

This section is empty.

Types

type KeepAliveEventListener added in v1.0.4

type KeepAliveEventListener func(lease clientv3.LeaseID) error

type KeyValue added in v1.0.13

type KeyValue struct {
	Key   string
	Value string
}

type LeaseOpBuild

type LeaseOpBuild func(leaseID clientv3.LeaseID) ([]clientv3.Op, string, error)

LeaseOpBuild return clientv3.Op[], string to description of lease, error if raise error

type Lock added in v1.0.11

type Lock struct {
	// contains filtered or unexported fields
}

func (*Lock) Mutex added in v1.0.11

func (l *Lock) Mutex() *concurrency.Mutex

func (*Lock) Session added in v1.0.11

func (l *Lock) Session() *concurrency.Session

func (*Lock) UnLock added in v1.0.11

func (l *Lock) UnLock() error

UnLock You should invoke Unlock function to release lock resources in defer segment

type TxnBuild

type TxnBuild func(txn clientv3.Txn, leaseID clientv3.LeaseID) (clientv3.Txn, string, error)

TxnBuild return clientv3.Op[], string to description of lease, error if raise error

type WatchChannelEventListener

type WatchChannelEventListener func(event *clientv3.Event)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL