Documentation ¶
Index ¶
- Variables
- type Backend
- type Event
- type 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 (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 (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) Watch(ws etcdserverpb.Watch_WatchServer) error
- type KeyValue
- type LimitedServer
- type RangeResponse
- type ResponseHeader
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 KVServerBridge ¶
type KVServerBridge struct {
// contains filtered or unexported fields
}
func New ¶
func New(backend Backend) *KVServerBridge
func (*KVServerBridge) Compact ¶
func (k *KVServerBridge) Compact(ctx context.Context, r *etcdserverpb.CompactionRequest) (*etcdserverpb.CompactionResponse, error)
func (*KVServerBridge) DeleteRange ¶
func (k *KVServerBridge) DeleteRange(ctx context.Context, r *etcdserverpb.DeleteRangeRequest) (*etcdserverpb.DeleteRangeResponse, error)
func (*KVServerBridge) LeaseGrant ¶
func (s *KVServerBridge) LeaseGrant(ctx context.Context, req *etcdserverpb.LeaseGrantRequest) (*etcdserverpb.LeaseGrantResponse, error)
func (*KVServerBridge) LeaseKeepAlive ¶
func (s *KVServerBridge) LeaseKeepAlive(etcdserverpb.Lease_LeaseKeepAliveServer) error
func (*KVServerBridge) LeaseLeases ¶
func (s *KVServerBridge) LeaseLeases(context.Context, *etcdserverpb.LeaseLeasesRequest) (*etcdserverpb.LeaseLeasesResponse, error)
func (*KVServerBridge) LeaseRevoke ¶
func (s *KVServerBridge) LeaseRevoke(context.Context, *etcdserverpb.LeaseRevokeRequest) (*etcdserverpb.LeaseRevokeResponse, error)
func (*KVServerBridge) LeaseTimeToLive ¶
func (s *KVServerBridge) LeaseTimeToLive(context.Context, *etcdserverpb.LeaseTimeToLiveRequest) (*etcdserverpb.LeaseTimeToLiveResponse, error)
func (*KVServerBridge) Put ¶
func (k *KVServerBridge) Put(ctx context.Context, r *etcdserverpb.PutRequest) (*etcdserverpb.PutResponse, error)
func (*KVServerBridge) Range ¶
func (k *KVServerBridge) Range(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error)
func (*KVServerBridge) Register ¶
func (k *KVServerBridge) Register(server *grpc.Server)
func (*KVServerBridge) Txn ¶
func (k *KVServerBridge) Txn(ctx context.Context, r *etcdserverpb.TxnRequest) (*etcdserverpb.TxnResponse, error)
func (*KVServerBridge) Watch ¶
func (s *KVServerBridge) Watch(ws etcdserverpb.Watch_WatchServer) error
type LimitedServer ¶
type LimitedServer struct {
// contains filtered or unexported fields
}
func (*LimitedServer) Range ¶
func (l *LimitedServer) Range(ctx context.Context, r *etcdserverpb.RangeRequest) (*RangeResponse, error)
func (*LimitedServer) Txn ¶
func (l *LimitedServer) Txn(ctx context.Context, txn *etcdserverpb.TxnRequest) (*etcdserverpb.TxnResponse, error)
type RangeResponse ¶
type RangeResponse struct { Header *etcdserverpb.ResponseHeader Kvs []*KeyValue More bool Count int64 }
type ResponseHeader ¶
type ResponseHeader struct {
Revision int64
}
Click to show internal directories.
Click to hide internal directories.