Versions in this module Expand all Collapse all v0 v0.2.0 Nov 5, 2019 Changes in this version + var ErrCompacted = errors.New("revision has been compact") + var ErrKeyExists = errors.New("key exists") + type Backend interface + Count func(ctx context.Context, prefix string) (int64, int64, error) + Create func(ctx context.Context, key string, value []byte, lease int64) (int64, error) + Delete func(ctx context.Context, key string, revision int64) (int64, *KeyValue, bool, error) + Get func(ctx context.Context, key string, revision int64) (int64, *KeyValue, error) + List func(ctx context.Context, prefix, startKey string, limit, revision int64) (int64, []*KeyValue, error) + Start func(ctx context.Context) error + Update func(ctx context.Context, key string, value []byte, revision, lease int64) (int64, *KeyValue, bool, error) + Watch func(ctx context.Context, key string, revision int64) <-chan []*Event + type Event struct + Create bool + Delete bool + KV *KeyValue + PrevKV *KeyValue + type KVServerBridge struct + func New(backend Backend) *KVServerBridge + func (k *KVServerBridge) Compact(ctx context.Context, r *etcdserverpb.CompactionRequest) (*etcdserverpb.CompactionResponse, error) + func (k *KVServerBridge) DeleteRange(ctx context.Context, r *etcdserverpb.DeleteRangeRequest) (*etcdserverpb.DeleteRangeResponse, error) + func (k *KVServerBridge) Put(ctx context.Context, r *etcdserverpb.PutRequest) (*etcdserverpb.PutResponse, error) + func (k *KVServerBridge) Range(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error) + func (k *KVServerBridge) Register(server *grpc.Server) + func (k *KVServerBridge) Txn(ctx context.Context, r *etcdserverpb.TxnRequest) (*etcdserverpb.TxnResponse, error) + func (s *KVServerBridge) LeaseGrant(ctx context.Context, req *etcdserverpb.LeaseGrantRequest) (*etcdserverpb.LeaseGrantResponse, error) + func (s *KVServerBridge) LeaseKeepAlive(etcdserverpb.Lease_LeaseKeepAliveServer) error + func (s *KVServerBridge) LeaseLeases(context.Context, *etcdserverpb.LeaseLeasesRequest) (*etcdserverpb.LeaseLeasesResponse, error) + func (s *KVServerBridge) LeaseRevoke(context.Context, *etcdserverpb.LeaseRevokeRequest) (*etcdserverpb.LeaseRevokeResponse, error) + func (s *KVServerBridge) LeaseTimeToLive(context.Context, *etcdserverpb.LeaseTimeToLiveRequest) (*etcdserverpb.LeaseTimeToLiveResponse, error) + func (s *KVServerBridge) Watch(ws etcdserverpb.Watch_WatchServer) error + type KeyValue struct + CreateRevision int64 + Key string + Lease int64 + ModRevision int64 + Value []byte + type LimitedServer struct + func (l *LimitedServer) Range(ctx context.Context, r *etcdserverpb.RangeRequest) (*RangeResponse, error) + func (l *LimitedServer) Txn(ctx context.Context, txn *etcdserverpb.TxnRequest) (*etcdserverpb.TxnResponse, error) + type RangeResponse struct + Count int64 + Header *etcdserverpb.ResponseHeader + Kvs []*KeyValue + More bool + type ResponseHeader struct + Revision int64