etcd_v3

package module
v3.0.0-...-2d88998 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Endpoint string = "ip:12379"
)

Functions

func Close

func Close()

func Compact

func Compact(rev int64, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func Delete

func Delete(key string) (int64, error)

func DeleteWithPrefix

func DeleteWithPrefix(prefix string) (int64, error)

func Get

func Get(key string) (string, error)

func GetWithPrefix

func GetWithPrefix(prefix string) (map[string]string, error)

func GrantLease

func GrantLease(timeout int64) (clientv3.LeaseID, error)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// minimum lease TTL is 5-second

func Init

func Init(endpoint string) error

func KeepAliveLease

func KeepAliveLease(leaseID clientv3.LeaseID) (<-chan *clientv3.LeaseKeepAliveResponse, error)

func Put

func Put(key string, value string) error

func PutWithLease

func PutWithLease(key string, value string, leaseID clientv3.LeaseID) error

func Watch

func Watch(key string) clientv3.WatchChan

func WatchLoop

func WatchLoop(rch clientv3.WatchChan, cb WatchCallback)

func WatchWithPrefix

func WatchWithPrefix(prefix string) clientv3.WatchChan

Types

type ErrNotFoundKey

type ErrNotFoundKey struct {
	Key string
}

func (ErrNotFoundKey) Error

func (e ErrNotFoundKey) Error() string

type WatchCallback

type WatchCallback func(ev *clientv3.Event)

Jump to

Keyboard shortcuts

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