client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("etcdwrapper: key not found")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	List(ctx context.Context, key string, rev int) ([]Value, error)
	Get(ctx context.Context, key string) (Value, error)
	Put(ctx context.Context, key string, value []byte) error
	Create(ctx context.Context, key string, value []byte) error
	Update(ctx context.Context, key string, revision int64, value []byte) error
	Delete(ctx context.Context, key string, revision int64) error
	Close() error
}

func New

func New(config endpoint.ETCDConfig) (Client, error)

type ClientK

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

func (*ClientK) Close

func (c *ClientK) Close() error

func (*ClientK) Create

func (c *ClientK) Create(ctx context.Context, key string, value []byte) error

func (*ClientK) Delete

func (c *ClientK) Delete(ctx context.Context, key string, revision int64) error

func (*ClientK) Get

func (c *ClientK) Get(ctx context.Context, key string) (Value, error)

func (*ClientK) List

func (c *ClientK) List(ctx context.Context, key string, rev int) ([]Value, error)

func (*ClientK) Put

func (c *ClientK) Put(ctx context.Context, key string, value []byte) error

func (*ClientK) Update

func (c *ClientK) Update(ctx context.Context, key string, revision int64, value []byte) error

type Value

type Value struct {
	Key      []byte
	Data     []byte
	Modified int64
}

Jump to

Keyboard shortcuts

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