Documentation ¶
Index ¶
- Constants
- type BackendShim
- type RPCServer
- func (s *RPCServer) Compact(ctx context.Context, r *etcdserverpb.CompactionRequest) (*etcdserverpb.CompactionResponse, error)
- func (s *RPCServer) DeleteRange(ctx context.Context, r *etcdserverpb.DeleteRangeRequest) (*etcdserverpb.DeleteRangeResponse, error)
- func (s *RPCServer) LeaseGrant(ctx context.Context, req *etcdserverpb.LeaseGrantRequest) (*etcdserverpb.LeaseGrantResponse, error)
- func (s *RPCServer) LeaseKeepAlive(etcdserverpb.Lease_LeaseKeepAliveServer) error
- func (s *RPCServer) LeaseLeases(context.Context, *etcdserverpb.LeaseLeasesRequest) (*etcdserverpb.LeaseLeasesResponse, error)
- func (s *RPCServer) LeaseRevoke(context.Context, *etcdserverpb.LeaseRevokeRequest) (*etcdserverpb.LeaseRevokeResponse, error)
- func (s *RPCServer) LeaseTimeToLive(context.Context, *etcdserverpb.LeaseTimeToLiveRequest) (*etcdserverpb.LeaseTimeToLiveResponse, error)
- func (s *RPCServer) MemberAdd(context.Context, *etcdserverpb.MemberAddRequest) (*etcdserverpb.MemberAddResponse, error)
- func (s *RPCServer) MemberList(context.Context, *etcdserverpb.MemberListRequest) (*etcdserverpb.MemberListResponse, error)
- func (s *RPCServer) MemberPromote(context.Context, *etcdserverpb.MemberPromoteRequest) (*etcdserverpb.MemberPromoteResponse, error)
- func (s *RPCServer) MemberRemove(context.Context, *etcdserverpb.MemberRemoveRequest) (*etcdserverpb.MemberRemoveResponse, error)
- func (s *RPCServer) MemberUpdate(context.Context, *etcdserverpb.MemberUpdateRequest) (*etcdserverpb.MemberUpdateResponse, error)
- func (s *RPCServer) Put(ctx context.Context, r *etcdserverpb.PutRequest) (*etcdserverpb.PutResponse, error)
- func (s *RPCServer) Range(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error)
- func (s *RPCServer) Register(server *grpc.Server)
- func (s *RPCServer) Txn(ctx context.Context, txn *etcdserverpb.TxnRequest) (*etcdserverpb.TxnResponse, error)
- func (s *RPCServer) Watch(ws etcdserverpb.Watch_WatchServer) error
Constants ¶
View Source
const ( // GetPartitionMagic is the Magic Number for get partition through range request GetPartitionMagic int64 = 1888 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendShim ¶
type BackendShim interface { // Create inserts new key into storage Create(ctx context.Context, put *etcdserverpb.PutRequest) (*etcdserverpb.TxnResponse, error) // Delete removes key from storage Delete(ctx context.Context, key []byte, revision int64) (*etcdserverpb.TxnResponse, error) // Update set key into storage Update(ctx context.Context, rev int64, key []byte, value []byte, lease int64) (*etcdserverpb.TxnResponse, error) // Compact clears the kvs that are too old Compact(ctx context.Context, revision uint64) (*etcdserverpb.TxnResponse, error) // Get read a kv from storage Get(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error) // List read kvs in range List(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error) // Count counts the number of kvs in range Count(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error) // GetPartitions query the partition state of storage for ListByStream GetPartitions(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error) // ListByStream reads kvs in range by stream ListByStream(ctx context.Context, startKey, endKey []byte, revision uint64) (<-chan *etcdserverpb.WatchResponse, error) // Watch subscribe the changes from revision on kvs with given prefix Watch(ctx context.Context, key string, revision uint64) (<-chan []*mvccpb.Event, error) // GetResourceLock returns the resource lock for leader election GetResourceLock() resourcelock.Interface // GetCurrentRevision returns the read revision GetCurrentRevision() uint64 // SetCurrentRevision is used for init tso for leader SetCurrentRevision(uint64) }
BackendShim wrapper Backend interface to adapt with Etcd grpc protobuf
func NewBackendShim ¶
func NewBackendShim(backend backend.Backend, metricCli metrics.Metrics) BackendShim
type RPCServer ¶
RPCServer only support limited method of etcd grpc server
func (*RPCServer) Compact ¶
func (s *RPCServer) Compact(ctx context.Context, r *etcdserverpb.CompactionRequest) (*etcdserverpb.CompactionResponse, error)
func (*RPCServer) DeleteRange ¶
func (s *RPCServer) DeleteRange(ctx context.Context, r *etcdserverpb.DeleteRangeRequest) (*etcdserverpb.DeleteRangeResponse, error)
func (*RPCServer) LeaseGrant ¶
func (s *RPCServer) LeaseGrant(ctx context.Context, req *etcdserverpb.LeaseGrantRequest) (*etcdserverpb.LeaseGrantResponse, error)
func (*RPCServer) LeaseKeepAlive ¶
func (s *RPCServer) LeaseKeepAlive(etcdserverpb.Lease_LeaseKeepAliveServer) error
func (*RPCServer) LeaseLeases ¶
func (s *RPCServer) LeaseLeases(context.Context, *etcdserverpb.LeaseLeasesRequest) (*etcdserverpb.LeaseLeasesResponse, error)
func (*RPCServer) LeaseRevoke ¶
func (s *RPCServer) LeaseRevoke(context.Context, *etcdserverpb.LeaseRevokeRequest) (*etcdserverpb.LeaseRevokeResponse, error)
func (*RPCServer) LeaseTimeToLive ¶
func (s *RPCServer) LeaseTimeToLive(context.Context, *etcdserverpb.LeaseTimeToLiveRequest) (*etcdserverpb.LeaseTimeToLiveResponse, error)
func (*RPCServer) MemberAdd ¶
func (s *RPCServer) MemberAdd(context.Context, *etcdserverpb.MemberAddRequest) (*etcdserverpb.MemberAddResponse, error)
MemberAdd adds a member into the cluster.
func (*RPCServer) MemberList ¶
func (s *RPCServer) MemberList(context.Context, *etcdserverpb.MemberListRequest) (*etcdserverpb.MemberListResponse, error)
MemberList lists the current cluster membership.
func (*RPCServer) MemberPromote ¶
func (s *RPCServer) MemberPromote(context.Context, *etcdserverpb.MemberPromoteRequest) (*etcdserverpb.MemberPromoteResponse, error)
MemberPromote promotes a member from raft learner (non-voting) to raft voting member.
func (*RPCServer) MemberRemove ¶
func (s *RPCServer) MemberRemove(context.Context, *etcdserverpb.MemberRemoveRequest) (*etcdserverpb.MemberRemoveResponse, error)
MemberRemove removes an existing member from the cluster.
func (*RPCServer) MemberUpdate ¶
func (s *RPCServer) MemberUpdate(context.Context, *etcdserverpb.MemberUpdateRequest) (*etcdserverpb.MemberUpdateResponse, error)
MemberUpdate updates the peer addresses of the member.
func (*RPCServer) Put ¶
func (s *RPCServer) Put(ctx context.Context, r *etcdserverpb.PutRequest) (*etcdserverpb.PutResponse, error)
func (*RPCServer) Range ¶
func (s *RPCServer) Range(ctx context.Context, r *etcdserverpb.RangeRequest) (*etcdserverpb.RangeResponse, error)
func (*RPCServer) Txn ¶
func (s *RPCServer) Txn(ctx context.Context, txn *etcdserverpb.TxnRequest) (*etcdserverpb.TxnResponse, error)
func (*RPCServer) Watch ¶
func (s *RPCServer) Watch(ws etcdserverpb.Watch_WatchServer) error
Click to show internal directories.
Click to hide internal directories.