server

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyExists = errors.New("key exists")
	ErrCompacted = errors.New("revision has been compact")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Start(ctx context.Context) error
	Get(ctx context.Context, key string, revision int64) (int64, *KeyValue, error)
	Create(ctx context.Context, key string, value []byte, lease int64) (int64, error)
	Delete(ctx context.Context, key string, revision int64) (int64, *KeyValue, bool, error)
	List(ctx context.Context, prefix, startKey string, limit, revision int64) (int64, []*KeyValue, error)
	Count(ctx context.Context, prefix string) (int64, int64, error)
	Update(ctx context.Context, key string, value []byte, revision, lease int64) (int64, *KeyValue, bool, error)
	Watch(ctx context.Context, key string, revision int64) <-chan []*Event
}

type Event

type Event struct {
	Delete bool
	Create bool
	KV     *KeyValue
	PrevKV *KeyValue
}

type KVServerBridge

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

func New

func New(backend Backend) *KVServerBridge

func (*KVServerBridge) LeaseGrant

func (*KVServerBridge) LeaseKeepAlive

func (*KVServerBridge) Put

func (*KVServerBridge) Range

func (*KVServerBridge) Register

func (k *KVServerBridge) Register(server *grpc.Server)

func (*KVServerBridge) Txn

func (*KVServerBridge) Watch

type KeyValue

type KeyValue struct {
	Key            string
	CreateRevision int64
	ModRevision    int64
	Value          []byte
	Lease          int64
}

type LimitedServer

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

func (*LimitedServer) Range

func (*LimitedServer) Txn

type RangeResponse

type RangeResponse struct {
	Header *etcdserverpb.ResponseHeader
	Kvs    []*KeyValue
	More   bool
	Count  int64
}

type ResponseHeader

type ResponseHeader struct {
	Revision int64
}

Jump to

Keyboard shortcuts

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