etcd

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...EtcdOpts) (storage.Connection, error)

Types

type Etcd

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

func (*Etcd) Bucket

func (e *Etcd) Bucket(bucket ...string) *storage.Bucket

func (*Etcd) Close

func (e *Etcd) Close()

func (*Etcd) Delete

func (e *Etcd) Delete(k string) error

func (*Etcd) Encoding

func (e *Etcd) Encoding() encoding.Coder

func (*Etcd) Exists

func (e *Etcd) Exists(k string) bool

func (*Etcd) Get

func (e *Etcd) Get(k string, v any) error

func (*Etcd) Iter

func (e *Etcd) Iter(ctx context.Context, pfx string) types.Iterator[string, []byte]

func (*Etcd) Keys

func (e *Etcd) Keys(pfx string) ([]string, error)

func (*Etcd) Len

func (e *Etcd) Len(pfx string) (int, error)

func (*Etcd) PrintDebug

func (e *Etcd) PrintDebug(pfx string) error

func (*Etcd) Set

func (e *Etcd) Set(k string, v any, op ...storage.Option) error

func (*Etcd) Tx

func (e *Etcd) Tx(pfx string, fn func(tx storage.Transactioner) error) error

func (*Etcd) Values

func (e *Etcd) Values(pfx string) ([][]byte, error)

func (*Etcd) Watch

func (e *Etcd) Watch(ctx context.Context, pfx string) types.Watcher[string, []byte]

type EtcdOpts

type EtcdOpts func(*Etcd) error

func Coder

func Coder(coder encoding.Coder) EtcdOpts

func Context

func Context(ctx context.Context) EtcdOpts

func Embed

func Embed(loadBalancer, token, dir string, test bool) EtcdOpts

Start single-node embedded etcd

func Endpoints

func Endpoints(edp ...string) EtcdOpts

Connect to etcd endpoints

func Logger added in v0.1.1

func Logger(lg storage.Logger) EtcdOpts

Jump to

Keyboard shortcuts

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