server

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyExists = rpctypes.ErrGRPCDuplicateKey
	ErrCompacted = rpctypes.ErrGRPCCompacted
)

Functions

This section is empty.

Types

type Backend

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

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) Status

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