etcdv3

package
v0.0.0-...-7b7dccf Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package etcdv3 is the etcd wrapper implementation.

Index

Constants

View Source
const (
	ErrCodeKeyNotFound int = iota + 1
	ErrCodeKeyExists
	ErrCodeResourceVersionConflicts
	ErrCodeInvalidObj
	ErrCodeUnreachable
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Create(ctx context.Context, object *model.KVPair) error
	Delete(ctx context.Context, k model.Key) error
	Watch(ctx context.Context, prefix string) clientv3.WatchChan
	Close()
}

func New

func New(config *config.NimbessConfig) (Client, error)

type ErrorDatastoreError

type ErrorDatastoreError struct {
	Err        error
	Identifier interface{}
}

Error indicating a problem connecting to the backend.

func (ErrorDatastoreError) Error

func (e ErrorDatastoreError) Error() string

type EtcdV3Client

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

func (*EtcdV3Client) Close

func (c *EtcdV3Client) Close()

func (*EtcdV3Client) Create

func (c *EtcdV3Client) Create(ctx context.Context, d *model.KVPair) error

func (*EtcdV3Client) Delete

func (c *EtcdV3Client) Delete(ctx context.Context, k model.Key) error

func (*EtcdV3Client) Watch

func (c *EtcdV3Client) Watch(ctx context.Context, prefix string) clientv3.WatchChan

Watch starts a watcher on a prefix and returns the channel

type StorageError

type StorageError struct {
	Code               int
	Key                string
	ResourceVersion    int64
	AdditionalErrorMsg string
}

func NewKeyExistsError

func NewKeyExistsError(key string, rv int64) *StorageError

func (*StorageError) Error

func (e *StorageError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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