Documentation ¶
Overview ¶
Package etcdserverpb is a generated protocol buffer package.
It is generated from these files:
etcdserver.proto raft_internal.proto rpc.proto
It has these top-level messages:
Request Metadata
Index ¶
- Variables
- func RegisterKVServer(s *grpc.Server, srv KVServer)
- func RegisterLeaseServer(s *grpc.Server, srv LeaseServer)
- func RegisterWatchServer(s *grpc.Server, srv WatchServer)
- type CompactionRequest
- func (m *CompactionRequest) Marshal() (data []byte, err error)
- func (m *CompactionRequest) MarshalTo(data []byte) (int, error)
- func (*CompactionRequest) ProtoMessage()
- func (m *CompactionRequest) Reset()
- func (m *CompactionRequest) Size() (n int)
- func (m *CompactionRequest) String() string
- func (m *CompactionRequest) Unmarshal(data []byte) error
- type CompactionResponse
- func (m *CompactionResponse) GetHeader() *ResponseHeader
- func (m *CompactionResponse) Marshal() (data []byte, err error)
- func (m *CompactionResponse) MarshalTo(data []byte) (int, error)
- func (*CompactionResponse) ProtoMessage()
- func (m *CompactionResponse) Reset()
- func (m *CompactionResponse) Size() (n int)
- func (m *CompactionResponse) String() string
- func (m *CompactionResponse) Unmarshal(data []byte) error
- type Compare
- type Compare_CompareResult
- type Compare_CompareTarget
- type DeleteRangeRequest
- func (m *DeleteRangeRequest) Marshal() (data []byte, err error)
- func (m *DeleteRangeRequest) MarshalTo(data []byte) (int, error)
- func (*DeleteRangeRequest) ProtoMessage()
- func (m *DeleteRangeRequest) Reset()
- func (m *DeleteRangeRequest) Size() (n int)
- func (m *DeleteRangeRequest) String() string
- func (m *DeleteRangeRequest) Unmarshal(data []byte) error
- type DeleteRangeResponse
- func (m *DeleteRangeResponse) GetHeader() *ResponseHeader
- func (m *DeleteRangeResponse) Marshal() (data []byte, err error)
- func (m *DeleteRangeResponse) MarshalTo(data []byte) (int, error)
- func (*DeleteRangeResponse) ProtoMessage()
- func (m *DeleteRangeResponse) Reset()
- func (m *DeleteRangeResponse) Size() (n int)
- func (m *DeleteRangeResponse) String() string
- func (m *DeleteRangeResponse) Unmarshal(data []byte) error
- type EmptyResponse
- func (m *EmptyResponse) Marshal() (data []byte, err error)
- func (m *EmptyResponse) MarshalTo(data []byte) (int, error)
- func (*EmptyResponse) ProtoMessage()
- func (m *EmptyResponse) Reset()
- func (m *EmptyResponse) Size() (n int)
- func (m *EmptyResponse) String() string
- func (m *EmptyResponse) Unmarshal(data []byte) error
- type InternalRaftRequest
- func (m *InternalRaftRequest) Marshal() (data []byte, err error)
- func (m *InternalRaftRequest) MarshalTo(data []byte) (int, error)
- func (*InternalRaftRequest) ProtoMessage()
- func (m *InternalRaftRequest) Reset()
- func (m *InternalRaftRequest) Size() (n int)
- func (m *InternalRaftRequest) String() string
- func (m *InternalRaftRequest) Unmarshal(data []byte) error
- type KVClient
- type KVServer
- type LeaseClient
- type LeaseCreateRequest
- func (m *LeaseCreateRequest) Marshal() (data []byte, err error)
- func (m *LeaseCreateRequest) MarshalTo(data []byte) (int, error)
- func (*LeaseCreateRequest) ProtoMessage()
- func (m *LeaseCreateRequest) Reset()
- func (m *LeaseCreateRequest) Size() (n int)
- func (m *LeaseCreateRequest) String() string
- func (m *LeaseCreateRequest) Unmarshal(data []byte) error
- type LeaseCreateResponse
- func (m *LeaseCreateResponse) GetHeader() *ResponseHeader
- func (m *LeaseCreateResponse) Marshal() (data []byte, err error)
- func (m *LeaseCreateResponse) MarshalTo(data []byte) (int, error)
- func (*LeaseCreateResponse) ProtoMessage()
- func (m *LeaseCreateResponse) Reset()
- func (m *LeaseCreateResponse) Size() (n int)
- func (m *LeaseCreateResponse) String() string
- func (m *LeaseCreateResponse) Unmarshal(data []byte) error
- type LeaseKeepAliveRequest
- func (m *LeaseKeepAliveRequest) Marshal() (data []byte, err error)
- func (m *LeaseKeepAliveRequest) MarshalTo(data []byte) (int, error)
- func (*LeaseKeepAliveRequest) ProtoMessage()
- func (m *LeaseKeepAliveRequest) Reset()
- func (m *LeaseKeepAliveRequest) Size() (n int)
- func (m *LeaseKeepAliveRequest) String() string
- func (m *LeaseKeepAliveRequest) Unmarshal(data []byte) error
- type LeaseKeepAliveResponse
- func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader
- func (m *LeaseKeepAliveResponse) Marshal() (data []byte, err error)
- func (m *LeaseKeepAliveResponse) MarshalTo(data []byte) (int, error)
- func (*LeaseKeepAliveResponse) ProtoMessage()
- func (m *LeaseKeepAliveResponse) Reset()
- func (m *LeaseKeepAliveResponse) Size() (n int)
- func (m *LeaseKeepAliveResponse) String() string
- func (m *LeaseKeepAliveResponse) Unmarshal(data []byte) error
- type LeaseRevokeRequest
- func (m *LeaseRevokeRequest) Marshal() (data []byte, err error)
- func (m *LeaseRevokeRequest) MarshalTo(data []byte) (int, error)
- func (*LeaseRevokeRequest) ProtoMessage()
- func (m *LeaseRevokeRequest) Reset()
- func (m *LeaseRevokeRequest) Size() (n int)
- func (m *LeaseRevokeRequest) String() string
- func (m *LeaseRevokeRequest) Unmarshal(data []byte) error
- type LeaseRevokeResponse
- func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader
- func (m *LeaseRevokeResponse) Marshal() (data []byte, err error)
- func (m *LeaseRevokeResponse) MarshalTo(data []byte) (int, error)
- func (*LeaseRevokeResponse) ProtoMessage()
- func (m *LeaseRevokeResponse) Reset()
- func (m *LeaseRevokeResponse) Size() (n int)
- func (m *LeaseRevokeResponse) String() string
- func (m *LeaseRevokeResponse) Unmarshal(data []byte) error
- type LeaseServer
- type Lease_LeaseKeepAliveClient
- type Lease_LeaseKeepAliveServer
- type Metadata
- type PutRequest
- type PutResponse
- func (m *PutResponse) GetHeader() *ResponseHeader
- func (m *PutResponse) Marshal() (data []byte, err error)
- func (m *PutResponse) MarshalTo(data []byte) (int, error)
- func (*PutResponse) ProtoMessage()
- func (m *PutResponse) Reset()
- func (m *PutResponse) Size() (n int)
- func (m *PutResponse) String() string
- func (m *PutResponse) Unmarshal(data []byte) error
- type RangeRequest
- func (m *RangeRequest) Marshal() (data []byte, err error)
- func (m *RangeRequest) MarshalTo(data []byte) (int, error)
- func (*RangeRequest) ProtoMessage()
- func (m *RangeRequest) Reset()
- func (m *RangeRequest) Size() (n int)
- func (m *RangeRequest) String() string
- func (m *RangeRequest) Unmarshal(data []byte) error
- type RangeRequest_SortOrder
- type RangeRequest_SortTarget
- type RangeResponse
- func (m *RangeResponse) GetHeader() *ResponseHeader
- func (m *RangeResponse) GetKvs() []*storagepb.KeyValue
- func (m *RangeResponse) Marshal() (data []byte, err error)
- func (m *RangeResponse) MarshalTo(data []byte) (int, error)
- func (*RangeResponse) ProtoMessage()
- func (m *RangeResponse) Reset()
- func (m *RangeResponse) Size() (n int)
- func (m *RangeResponse) String() string
- func (m *RangeResponse) Unmarshal(data []byte) error
- type Request
- type RequestUnion
- func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest
- func (m *RequestUnion) GetRequestPut() *PutRequest
- func (m *RequestUnion) GetRequestRange() *RangeRequest
- func (m *RequestUnion) Marshal() (data []byte, err error)
- func (m *RequestUnion) MarshalTo(data []byte) (int, error)
- func (*RequestUnion) ProtoMessage()
- func (m *RequestUnion) Reset()
- func (m *RequestUnion) Size() (n int)
- func (m *RequestUnion) String() string
- func (m *RequestUnion) Unmarshal(data []byte) error
- type ResponseHeader
- func (m *ResponseHeader) Marshal() (data []byte, err error)
- func (m *ResponseHeader) MarshalTo(data []byte) (int, error)
- func (*ResponseHeader) ProtoMessage()
- func (m *ResponseHeader) Reset()
- func (m *ResponseHeader) Size() (n int)
- func (m *ResponseHeader) String() string
- func (m *ResponseHeader) Unmarshal(data []byte) error
- type ResponseUnion
- func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse
- func (m *ResponseUnion) GetResponsePut() *PutResponse
- func (m *ResponseUnion) GetResponseRange() *RangeResponse
- func (m *ResponseUnion) Marshal() (data []byte, err error)
- func (m *ResponseUnion) MarshalTo(data []byte) (int, error)
- func (*ResponseUnion) ProtoMessage()
- func (m *ResponseUnion) Reset()
- func (m *ResponseUnion) Size() (n int)
- func (m *ResponseUnion) String() string
- func (m *ResponseUnion) Unmarshal(data []byte) error
- type TxnRequest
- func (m *TxnRequest) GetCompare() []*Compare
- func (m *TxnRequest) GetFailure() []*RequestUnion
- func (m *TxnRequest) GetSuccess() []*RequestUnion
- func (m *TxnRequest) Marshal() (data []byte, err error)
- func (m *TxnRequest) MarshalTo(data []byte) (int, error)
- func (*TxnRequest) ProtoMessage()
- func (m *TxnRequest) Reset()
- func (m *TxnRequest) Size() (n int)
- func (m *TxnRequest) String() string
- func (m *TxnRequest) Unmarshal(data []byte) error
- type TxnResponse
- func (m *TxnResponse) GetHeader() *ResponseHeader
- func (m *TxnResponse) GetResponses() []*ResponseUnion
- func (m *TxnResponse) Marshal() (data []byte, err error)
- func (m *TxnResponse) MarshalTo(data []byte) (int, error)
- func (*TxnResponse) ProtoMessage()
- func (m *TxnResponse) Reset()
- func (m *TxnResponse) Size() (n int)
- func (m *TxnResponse) String() string
- func (m *TxnResponse) Unmarshal(data []byte) error
- type WatchCancelRequest
- func (m *WatchCancelRequest) Marshal() (data []byte, err error)
- func (m *WatchCancelRequest) MarshalTo(data []byte) (int, error)
- func (*WatchCancelRequest) ProtoMessage()
- func (m *WatchCancelRequest) Reset()
- func (m *WatchCancelRequest) Size() (n int)
- func (m *WatchCancelRequest) String() string
- func (m *WatchCancelRequest) Unmarshal(data []byte) error
- type WatchClient
- type WatchCreateRequest
- func (m *WatchCreateRequest) Marshal() (data []byte, err error)
- func (m *WatchCreateRequest) MarshalTo(data []byte) (int, error)
- func (*WatchCreateRequest) ProtoMessage()
- func (m *WatchCreateRequest) Reset()
- func (m *WatchCreateRequest) Size() (n int)
- func (m *WatchCreateRequest) String() string
- func (m *WatchCreateRequest) Unmarshal(data []byte) error
- type WatchRequest
- func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest
- func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest
- func (m *WatchRequest) Marshal() (data []byte, err error)
- func (m *WatchRequest) MarshalTo(data []byte) (int, error)
- func (*WatchRequest) ProtoMessage()
- func (m *WatchRequest) Reset()
- func (m *WatchRequest) Size() (n int)
- func (m *WatchRequest) String() string
- func (m *WatchRequest) Unmarshal(data []byte) error
- type WatchResponse
- func (m *WatchResponse) GetEvents() []*storagepb.Event
- func (m *WatchResponse) GetHeader() *ResponseHeader
- func (m *WatchResponse) Marshal() (data []byte, err error)
- func (m *WatchResponse) MarshalTo(data []byte) (int, error)
- func (*WatchResponse) ProtoMessage()
- func (m *WatchResponse) Reset()
- func (m *WatchResponse) Size() (n int)
- func (m *WatchResponse) String() string
- func (m *WatchResponse) Unmarshal(data []byte) error
- type WatchServer
- type Watch_WatchClient
- type Watch_WatchServer
Constants ¶
This section is empty.
Variables ¶
var Compare_CompareResult_name = map[int32]string{
0: "EQUAL",
1: "GREATER",
2: "LESS",
}
var Compare_CompareResult_value = map[string]int32{
"EQUAL": 0,
"GREATER": 1,
"LESS": 2,
}
var Compare_CompareTarget_name = map[int32]string{
0: "VERSION",
1: "CREATE",
2: "MOD",
3: "VALUE",
}
var Compare_CompareTarget_value = map[string]int32{
"VERSION": 0,
"CREATE": 1,
"MOD": 2,
"VALUE": 3,
}
var (
ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling")
)
var (
ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling")
)
var RangeRequest_SortOrder_name = map[int32]string{
0: "NONE",
1: "ASCEND",
2: "DESCEND",
}
var RangeRequest_SortOrder_value = map[string]int32{
"NONE": 0,
"ASCEND": 1,
"DESCEND": 2,
}
var RangeRequest_SortTarget_name = map[int32]string{
0: "KEY",
1: "VERSION",
2: "CREATE",
3: "MOD",
4: "VALUE",
}
var RangeRequest_SortTarget_value = map[string]int32{
"KEY": 0,
"VERSION": 1,
"CREATE": 2,
"MOD": 3,
"VALUE": 4,
}
Functions ¶
func RegisterKVServer ¶
func RegisterLeaseServer ¶
func RegisterLeaseServer(s *grpc.Server, srv LeaseServer)
func RegisterWatchServer ¶
func RegisterWatchServer(s *grpc.Server, srv WatchServer)
Types ¶
type CompactionRequest ¶
type CompactionRequest struct {
Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
}
Compaction compacts the kv store upto the given revision (including). It removes the old versions of a key. It keeps the newest version of the key even if its latest modification revision is smaller than the given revision.
func (*CompactionRequest) Marshal ¶
func (m *CompactionRequest) Marshal() (data []byte, err error)
func (*CompactionRequest) MarshalTo ¶
func (m *CompactionRequest) MarshalTo(data []byte) (int, error)
func (*CompactionRequest) ProtoMessage ¶
func (*CompactionRequest) ProtoMessage()
func (*CompactionRequest) Reset ¶
func (m *CompactionRequest) Reset()
func (*CompactionRequest) Size ¶
func (m *CompactionRequest) Size() (n int)
func (*CompactionRequest) String ¶
func (m *CompactionRequest) String() string
func (*CompactionRequest) Unmarshal ¶
func (m *CompactionRequest) Unmarshal(data []byte) error
type CompactionResponse ¶
type CompactionResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
}
func (*CompactionResponse) GetHeader ¶
func (m *CompactionResponse) GetHeader() *ResponseHeader
func (*CompactionResponse) Marshal ¶
func (m *CompactionResponse) Marshal() (data []byte, err error)
func (*CompactionResponse) MarshalTo ¶
func (m *CompactionResponse) MarshalTo(data []byte) (int, error)
func (*CompactionResponse) ProtoMessage ¶
func (*CompactionResponse) ProtoMessage()
func (*CompactionResponse) Reset ¶
func (m *CompactionResponse) Reset()
func (*CompactionResponse) Size ¶
func (m *CompactionResponse) Size() (n int)
func (*CompactionResponse) String ¶
func (m *CompactionResponse) String() string
func (*CompactionResponse) Unmarshal ¶
func (m *CompactionResponse) Unmarshal(data []byte) error
type Compare ¶
type Compare struct { Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"` Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"` // key path Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // version of the given key Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` // create revision of the given key CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3" json:"create_revision,omitempty"` // last modified revision of the given key ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"` // value of the given key Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` }
func (*Compare) ProtoMessage ¶
func (*Compare) ProtoMessage()
type Compare_CompareResult ¶
type Compare_CompareResult int32
const ( Compare_EQUAL Compare_CompareResult = 0 Compare_GREATER Compare_CompareResult = 1 Compare_LESS Compare_CompareResult = 2 )
func (Compare_CompareResult) String ¶
func (x Compare_CompareResult) String() string
type Compare_CompareTarget ¶
type Compare_CompareTarget int32
const ( Compare_VERSION Compare_CompareTarget = 0 Compare_CREATE Compare_CompareTarget = 1 Compare_MOD Compare_CompareTarget = 2 Compare_VALUE Compare_CompareTarget = 3 )
func (Compare_CompareTarget) String ¶
func (x Compare_CompareTarget) String() string
type DeleteRangeRequest ¶
type DeleteRangeRequest struct { // if the range_end is not given, the request deletes the key. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // if the range_end is given, it deletes the keys in range [key, range_end). RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"` }
func (*DeleteRangeRequest) Marshal ¶
func (m *DeleteRangeRequest) Marshal() (data []byte, err error)
func (*DeleteRangeRequest) MarshalTo ¶
func (m *DeleteRangeRequest) MarshalTo(data []byte) (int, error)
func (*DeleteRangeRequest) ProtoMessage ¶
func (*DeleteRangeRequest) ProtoMessage()
func (*DeleteRangeRequest) Reset ¶
func (m *DeleteRangeRequest) Reset()
func (*DeleteRangeRequest) Size ¶
func (m *DeleteRangeRequest) Size() (n int)
func (*DeleteRangeRequest) String ¶
func (m *DeleteRangeRequest) String() string
func (*DeleteRangeRequest) Unmarshal ¶
func (m *DeleteRangeRequest) Unmarshal(data []byte) error
type DeleteRangeResponse ¶
type DeleteRangeResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
}
func (*DeleteRangeResponse) GetHeader ¶
func (m *DeleteRangeResponse) GetHeader() *ResponseHeader
func (*DeleteRangeResponse) Marshal ¶
func (m *DeleteRangeResponse) Marshal() (data []byte, err error)
func (*DeleteRangeResponse) MarshalTo ¶
func (m *DeleteRangeResponse) MarshalTo(data []byte) (int, error)
func (*DeleteRangeResponse) ProtoMessage ¶
func (*DeleteRangeResponse) ProtoMessage()
func (*DeleteRangeResponse) Reset ¶
func (m *DeleteRangeResponse) Reset()
func (*DeleteRangeResponse) Size ¶
func (m *DeleteRangeResponse) Size() (n int)
func (*DeleteRangeResponse) String ¶
func (m *DeleteRangeResponse) String() string
func (*DeleteRangeResponse) Unmarshal ¶
func (m *DeleteRangeResponse) Unmarshal(data []byte) error
type EmptyResponse ¶
type EmptyResponse struct { }
func (*EmptyResponse) Marshal ¶
func (m *EmptyResponse) Marshal() (data []byte, err error)
func (*EmptyResponse) ProtoMessage ¶
func (*EmptyResponse) ProtoMessage()
func (*EmptyResponse) Reset ¶
func (m *EmptyResponse) Reset()
func (*EmptyResponse) Size ¶
func (m *EmptyResponse) Size() (n int)
func (*EmptyResponse) String ¶
func (m *EmptyResponse) String() string
func (*EmptyResponse) Unmarshal ¶
func (m *EmptyResponse) Unmarshal(data []byte) error
type InternalRaftRequest ¶
type InternalRaftRequest struct { ID uint64 `protobuf:"varint,1,opt,proto3" json:"ID,omitempty"` V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"` Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"` Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range" json:"delete_range,omitempty"` Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"` Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"` LeaseCreate *LeaseCreateRequest `protobuf:"bytes,8,opt,name=lease_create" json:"lease_create,omitempty"` LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke" json:"lease_revoke,omitempty"` }
An InternalRaftRequest is the union of all requests which can be sent via raft.
func (*InternalRaftRequest) Marshal ¶
func (m *InternalRaftRequest) Marshal() (data []byte, err error)
func (*InternalRaftRequest) MarshalTo ¶
func (m *InternalRaftRequest) MarshalTo(data []byte) (int, error)
func (*InternalRaftRequest) ProtoMessage ¶
func (*InternalRaftRequest) ProtoMessage()
func (*InternalRaftRequest) Reset ¶
func (m *InternalRaftRequest) Reset()
func (*InternalRaftRequest) Size ¶
func (m *InternalRaftRequest) Size() (n int)
func (*InternalRaftRequest) String ¶
func (m *InternalRaftRequest) String() string
func (*InternalRaftRequest) Unmarshal ¶
func (m *InternalRaftRequest) Unmarshal(data []byte) error
type KVClient ¶
type KVClient interface { // Range gets the keys in the range from the store. Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) // Put puts the given key into the store. // A put request increases the revision of the store, // and generates one event in the event history. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // Delete deletes the given range from the store. // A delete request increase the revision of the store, // and generates one event in the event history. DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) // Txn processes all the requests in one transaction. // A txn request increases the revision of the store, // and generates events with the same revision in the event history. // It is not allowed to modify the same key several times within one txn. Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) // Compact compacts the event history in etcd. User should compact the // event history periodically, or it will grow infinitely. Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) }
func NewKVClient ¶
func NewKVClient(cc *grpc.ClientConn) KVClient
type KVServer ¶
type KVServer interface { // Range gets the keys in the range from the store. Range(context.Context, *RangeRequest) (*RangeResponse, error) // Put puts the given key into the store. // A put request increases the revision of the store, // and generates one event in the event history. Put(context.Context, *PutRequest) (*PutResponse, error) // Delete deletes the given range from the store. // A delete request increase the revision of the store, // and generates one event in the event history. DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error) // Txn processes all the requests in one transaction. // A txn request increases the revision of the store, // and generates events with the same revision in the event history. // It is not allowed to modify the same key several times within one txn. Txn(context.Context, *TxnRequest) (*TxnResponse, error) // Compact compacts the event history in etcd. User should compact the // event history periodically, or it will grow infinitely. Compact(context.Context, *CompactionRequest) (*CompactionResponse, error) }
type LeaseClient ¶
type LeaseClient interface { // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the // server does not receive a keepAlive within TTL from the lease holder. // All keys attached to the lease will be expired and deleted if the lease expires. // The key expiration generates an event in event history. LeaseCreate(ctx context.Context, in *LeaseCreateRequest, opts ...grpc.CallOption) (*LeaseCreateResponse, error) // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted. LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) // KeepAlive keeps the lease alive. LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) }
func NewLeaseClient ¶
func NewLeaseClient(cc *grpc.ClientConn) LeaseClient
type LeaseCreateRequest ¶
type LeaseCreateRequest struct { // advisory ttl in seconds TTL int64 `protobuf:"varint,1,opt,proto3" json:"TTL,omitempty"` // requested ID to create; 0 lets lessor choose ID int64 `protobuf:"varint,2,opt,proto3" json:"ID,omitempty"` }
func (*LeaseCreateRequest) Marshal ¶
func (m *LeaseCreateRequest) Marshal() (data []byte, err error)
func (*LeaseCreateRequest) MarshalTo ¶
func (m *LeaseCreateRequest) MarshalTo(data []byte) (int, error)
func (*LeaseCreateRequest) ProtoMessage ¶
func (*LeaseCreateRequest) ProtoMessage()
func (*LeaseCreateRequest) Reset ¶
func (m *LeaseCreateRequest) Reset()
func (*LeaseCreateRequest) Size ¶
func (m *LeaseCreateRequest) Size() (n int)
func (*LeaseCreateRequest) String ¶
func (m *LeaseCreateRequest) String() string
func (*LeaseCreateRequest) Unmarshal ¶
func (m *LeaseCreateRequest) Unmarshal(data []byte) error
type LeaseCreateResponse ¶
type LeaseCreateResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` ID int64 `protobuf:"varint,2,opt,proto3" json:"ID,omitempty"` // server decided ttl in second TTL int64 `protobuf:"varint,3,opt,proto3" json:"TTL,omitempty"` Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` }
func (*LeaseCreateResponse) GetHeader ¶
func (m *LeaseCreateResponse) GetHeader() *ResponseHeader
func (*LeaseCreateResponse) Marshal ¶
func (m *LeaseCreateResponse) Marshal() (data []byte, err error)
func (*LeaseCreateResponse) MarshalTo ¶
func (m *LeaseCreateResponse) MarshalTo(data []byte) (int, error)
func (*LeaseCreateResponse) ProtoMessage ¶
func (*LeaseCreateResponse) ProtoMessage()
func (*LeaseCreateResponse) Reset ¶
func (m *LeaseCreateResponse) Reset()
func (*LeaseCreateResponse) Size ¶
func (m *LeaseCreateResponse) Size() (n int)
func (*LeaseCreateResponse) String ¶
func (m *LeaseCreateResponse) String() string
func (*LeaseCreateResponse) Unmarshal ¶
func (m *LeaseCreateResponse) Unmarshal(data []byte) error
type LeaseKeepAliveRequest ¶
type LeaseKeepAliveRequest struct {
ID int64 `protobuf:"varint,1,opt,proto3" json:"ID,omitempty"`
}
func (*LeaseKeepAliveRequest) Marshal ¶
func (m *LeaseKeepAliveRequest) Marshal() (data []byte, err error)
func (*LeaseKeepAliveRequest) MarshalTo ¶
func (m *LeaseKeepAliveRequest) MarshalTo(data []byte) (int, error)
func (*LeaseKeepAliveRequest) ProtoMessage ¶
func (*LeaseKeepAliveRequest) ProtoMessage()
func (*LeaseKeepAliveRequest) Reset ¶
func (m *LeaseKeepAliveRequest) Reset()
func (*LeaseKeepAliveRequest) Size ¶
func (m *LeaseKeepAliveRequest) Size() (n int)
func (*LeaseKeepAliveRequest) String ¶
func (m *LeaseKeepAliveRequest) String() string
func (*LeaseKeepAliveRequest) Unmarshal ¶
func (m *LeaseKeepAliveRequest) Unmarshal(data []byte) error
type LeaseKeepAliveResponse ¶
type LeaseKeepAliveResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` ID int64 `protobuf:"varint,2,opt,proto3" json:"ID,omitempty"` TTL int64 `protobuf:"varint,3,opt,proto3" json:"TTL,omitempty"` }
func (*LeaseKeepAliveResponse) GetHeader ¶
func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader
func (*LeaseKeepAliveResponse) Marshal ¶
func (m *LeaseKeepAliveResponse) Marshal() (data []byte, err error)
func (*LeaseKeepAliveResponse) MarshalTo ¶
func (m *LeaseKeepAliveResponse) MarshalTo(data []byte) (int, error)
func (*LeaseKeepAliveResponse) ProtoMessage ¶
func (*LeaseKeepAliveResponse) ProtoMessage()
func (*LeaseKeepAliveResponse) Reset ¶
func (m *LeaseKeepAliveResponse) Reset()
func (*LeaseKeepAliveResponse) Size ¶
func (m *LeaseKeepAliveResponse) Size() (n int)
func (*LeaseKeepAliveResponse) String ¶
func (m *LeaseKeepAliveResponse) String() string
func (*LeaseKeepAliveResponse) Unmarshal ¶
func (m *LeaseKeepAliveResponse) Unmarshal(data []byte) error
type LeaseRevokeRequest ¶
type LeaseRevokeRequest struct {
ID int64 `protobuf:"varint,1,opt,proto3" json:"ID,omitempty"`
}
func (*LeaseRevokeRequest) Marshal ¶
func (m *LeaseRevokeRequest) Marshal() (data []byte, err error)
func (*LeaseRevokeRequest) MarshalTo ¶
func (m *LeaseRevokeRequest) MarshalTo(data []byte) (int, error)
func (*LeaseRevokeRequest) ProtoMessage ¶
func (*LeaseRevokeRequest) ProtoMessage()
func (*LeaseRevokeRequest) Reset ¶
func (m *LeaseRevokeRequest) Reset()
func (*LeaseRevokeRequest) Size ¶
func (m *LeaseRevokeRequest) Size() (n int)
func (*LeaseRevokeRequest) String ¶
func (m *LeaseRevokeRequest) String() string
func (*LeaseRevokeRequest) Unmarshal ¶
func (m *LeaseRevokeRequest) Unmarshal(data []byte) error
type LeaseRevokeResponse ¶
type LeaseRevokeResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
}
func (*LeaseRevokeResponse) GetHeader ¶
func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader
func (*LeaseRevokeResponse) Marshal ¶
func (m *LeaseRevokeResponse) Marshal() (data []byte, err error)
func (*LeaseRevokeResponse) MarshalTo ¶
func (m *LeaseRevokeResponse) MarshalTo(data []byte) (int, error)
func (*LeaseRevokeResponse) ProtoMessage ¶
func (*LeaseRevokeResponse) ProtoMessage()
func (*LeaseRevokeResponse) Reset ¶
func (m *LeaseRevokeResponse) Reset()
func (*LeaseRevokeResponse) Size ¶
func (m *LeaseRevokeResponse) Size() (n int)
func (*LeaseRevokeResponse) String ¶
func (m *LeaseRevokeResponse) String() string
func (*LeaseRevokeResponse) Unmarshal ¶
func (m *LeaseRevokeResponse) Unmarshal(data []byte) error
type LeaseServer ¶
type LeaseServer interface { // LeaseCreate creates a lease. A lease has a TTL. The lease will expire if the // server does not receive a keepAlive within TTL from the lease holder. // All keys attached to the lease will be expired and deleted if the lease expires. // The key expiration generates an event in event history. LeaseCreate(context.Context, *LeaseCreateRequest) (*LeaseCreateResponse, error) // LeaseRevoke revokes a lease. All the key attached to the lease will be expired and deleted. LeaseRevoke(context.Context, *LeaseRevokeRequest) (*LeaseRevokeResponse, error) // KeepAlive keeps the lease alive. LeaseKeepAlive(Lease_LeaseKeepAliveServer) error }
type Lease_LeaseKeepAliveClient ¶
type Lease_LeaseKeepAliveClient interface { Send(*LeaseKeepAliveRequest) error Recv() (*LeaseKeepAliveResponse, error) grpc.ClientStream }
type Lease_LeaseKeepAliveServer ¶
type Lease_LeaseKeepAliveServer interface { Send(*LeaseKeepAliveResponse) error Recv() (*LeaseKeepAliveRequest, error) grpc.ServerStream }
type Metadata ¶
type Metadata struct { NodeID uint64 `protobuf:"varint,1,opt" json:"NodeID"` ClusterID uint64 `protobuf:"varint,2,opt" json:"ClusterID"` XXX_unrecognized []byte `json:"-"` }
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
type PutRequest ¶
type PutRequest struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Lease int64 `protobuf:"varint,3,opt,name=lease,proto3" json:"lease,omitempty"` }
func (*PutRequest) Marshal ¶
func (m *PutRequest) Marshal() (data []byte, err error)
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) Reset ¶
func (m *PutRequest) Reset()
func (*PutRequest) Size ¶
func (m *PutRequest) Size() (n int)
func (*PutRequest) String ¶
func (m *PutRequest) String() string
func (*PutRequest) Unmarshal ¶
func (m *PutRequest) Unmarshal(data []byte) error
type PutResponse ¶
type PutResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
}
func (*PutResponse) GetHeader ¶
func (m *PutResponse) GetHeader() *ResponseHeader
func (*PutResponse) Marshal ¶
func (m *PutResponse) Marshal() (data []byte, err error)
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) Reset ¶
func (m *PutResponse) Reset()
func (*PutResponse) Size ¶
func (m *PutResponse) Size() (n int)
func (*PutResponse) String ¶
func (m *PutResponse) String() string
func (*PutResponse) Unmarshal ¶
func (m *PutResponse) Unmarshal(data []byte) error
type RangeRequest ¶
type RangeRequest struct { // if the range_end is not given, the request returns the key. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // if the range_end is given, it gets the keys in range [key, range_end). RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"` // limit the number of keys returned. Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // range over the store at the given revision. // if revision is less or equal to zero, range over the newest store. // if the revision has been compacted, ErrCompaction will be returned in // response. Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` // sort_order is the requested order for returned the results SortOrder RangeRequest_SortOrder `protobuf:"varint,5,opt,name=sort_order,proto3,enum=etcdserverpb.RangeRequest_SortOrder" json:"sort_order,omitempty"` // sort_target is the kv field to use for sorting SortTarget RangeRequest_SortTarget `protobuf:"varint,6,opt,name=sort_target,proto3,enum=etcdserverpb.RangeRequest_SortTarget" json:"sort_target,omitempty"` }
func (*RangeRequest) Marshal ¶
func (m *RangeRequest) Marshal() (data []byte, err error)
func (*RangeRequest) ProtoMessage ¶
func (*RangeRequest) ProtoMessage()
func (*RangeRequest) Reset ¶
func (m *RangeRequest) Reset()
func (*RangeRequest) Size ¶
func (m *RangeRequest) Size() (n int)
func (*RangeRequest) String ¶
func (m *RangeRequest) String() string
func (*RangeRequest) Unmarshal ¶
func (m *RangeRequest) Unmarshal(data []byte) error
type RangeRequest_SortOrder ¶
type RangeRequest_SortOrder int32
const ( RangeRequest_NONE RangeRequest_SortOrder = 0 RangeRequest_ASCEND RangeRequest_SortOrder = 1 RangeRequest_DESCEND RangeRequest_SortOrder = 2 )
func (RangeRequest_SortOrder) String ¶
func (x RangeRequest_SortOrder) String() string
type RangeRequest_SortTarget ¶
type RangeRequest_SortTarget int32
const ( RangeRequest_KEY RangeRequest_SortTarget = 0 RangeRequest_VERSION RangeRequest_SortTarget = 1 RangeRequest_CREATE RangeRequest_SortTarget = 2 RangeRequest_MOD RangeRequest_SortTarget = 3 RangeRequest_VALUE RangeRequest_SortTarget = 4 )
func (RangeRequest_SortTarget) String ¶
func (x RangeRequest_SortTarget) String() string
type RangeResponse ¶
type RangeResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Kvs []*storagepb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"` // more indicates if there are more keys to return in the requested range. More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"` }
func (*RangeResponse) GetHeader ¶
func (m *RangeResponse) GetHeader() *ResponseHeader
func (*RangeResponse) GetKvs ¶
func (m *RangeResponse) GetKvs() []*storagepb.KeyValue
func (*RangeResponse) Marshal ¶
func (m *RangeResponse) Marshal() (data []byte, err error)
func (*RangeResponse) ProtoMessage ¶
func (*RangeResponse) ProtoMessage()
func (*RangeResponse) Reset ¶
func (m *RangeResponse) Reset()
func (*RangeResponse) Size ¶
func (m *RangeResponse) Size() (n int)
func (*RangeResponse) String ¶
func (m *RangeResponse) String() string
func (*RangeResponse) Unmarshal ¶
func (m *RangeResponse) Unmarshal(data []byte) error
type Request ¶
type Request struct { ID uint64 `protobuf:"varint,1,opt" json:"ID"` Method string `protobuf:"bytes,2,opt" json:"Method"` Path string `protobuf:"bytes,3,opt" json:"Path"` Val string `protobuf:"bytes,4,opt" json:"Val"` Dir bool `protobuf:"varint,5,opt" json:"Dir"` PrevValue string `protobuf:"bytes,6,opt" json:"PrevValue"` PrevIndex uint64 `protobuf:"varint,7,opt" json:"PrevIndex"` PrevExist *bool `protobuf:"varint,8,opt" json:"PrevExist,omitempty"` Expiration int64 `protobuf:"varint,9,opt" json:"Expiration"` Wait bool `protobuf:"varint,10,opt" json:"Wait"` Since uint64 `protobuf:"varint,11,opt" json:"Since"` Recursive bool `protobuf:"varint,12,opt" json:"Recursive"` Sorted bool `protobuf:"varint,13,opt" json:"Sorted"` Quorum bool `protobuf:"varint,14,opt" json:"Quorum"` Time int64 `protobuf:"varint,15,opt" json:"Time"` Stream bool `protobuf:"varint,16,opt" json:"Stream"` XXX_unrecognized []byte `json:"-"` }
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
type RequestUnion ¶
type RequestUnion struct { RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range" json:"request_range,omitempty"` RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put" json:"request_put,omitempty"` RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range" json:"request_delete_range,omitempty"` }
func (*RequestUnion) GetRequestDeleteRange ¶
func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest
func (*RequestUnion) GetRequestPut ¶
func (m *RequestUnion) GetRequestPut() *PutRequest
func (*RequestUnion) GetRequestRange ¶
func (m *RequestUnion) GetRequestRange() *RangeRequest
func (*RequestUnion) Marshal ¶
func (m *RequestUnion) Marshal() (data []byte, err error)
func (*RequestUnion) ProtoMessage ¶
func (*RequestUnion) ProtoMessage()
func (*RequestUnion) Reset ¶
func (m *RequestUnion) Reset()
func (*RequestUnion) Size ¶
func (m *RequestUnion) Size() (n int)
func (*RequestUnion) String ¶
func (m *RequestUnion) String() string
func (*RequestUnion) Unmarshal ¶
func (m *RequestUnion) Unmarshal(data []byte) error
type ResponseHeader ¶
type ResponseHeader struct { ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"` MemberId uint64 `protobuf:"varint,2,opt,name=member_id,proto3" json:"member_id,omitempty"` // revision of the store when the request was applied. Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` // term of raft when the request was applied. RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,proto3" json:"raft_term,omitempty"` }
func (*ResponseHeader) Marshal ¶
func (m *ResponseHeader) Marshal() (data []byte, err error)
func (*ResponseHeader) ProtoMessage ¶
func (*ResponseHeader) ProtoMessage()
func (*ResponseHeader) Reset ¶
func (m *ResponseHeader) Reset()
func (*ResponseHeader) Size ¶
func (m *ResponseHeader) Size() (n int)
func (*ResponseHeader) String ¶
func (m *ResponseHeader) String() string
func (*ResponseHeader) Unmarshal ¶
func (m *ResponseHeader) Unmarshal(data []byte) error
type ResponseUnion ¶
type ResponseUnion struct { ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range" json:"response_range,omitempty"` ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put" json:"response_put,omitempty"` ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range" json:"response_delete_range,omitempty"` }
func (*ResponseUnion) GetResponseDeleteRange ¶
func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse
func (*ResponseUnion) GetResponsePut ¶
func (m *ResponseUnion) GetResponsePut() *PutResponse
func (*ResponseUnion) GetResponseRange ¶
func (m *ResponseUnion) GetResponseRange() *RangeResponse
func (*ResponseUnion) Marshal ¶
func (m *ResponseUnion) Marshal() (data []byte, err error)
func (*ResponseUnion) ProtoMessage ¶
func (*ResponseUnion) ProtoMessage()
func (*ResponseUnion) Reset ¶
func (m *ResponseUnion) Reset()
func (*ResponseUnion) Size ¶
func (m *ResponseUnion) Size() (n int)
func (*ResponseUnion) String ¶
func (m *ResponseUnion) String() string
func (*ResponseUnion) Unmarshal ¶
func (m *ResponseUnion) Unmarshal(data []byte) error
type TxnRequest ¶
type TxnRequest struct { Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"` Success []*RequestUnion `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"` Failure []*RequestUnion `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"` }
From google paxosdb paper: Our implementation hinges around a powerful primitive which we call MultiOp. All other database operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically and consists of three components: 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check for the absence or presence of a value, or compare with a given value. Two different tests in the guard may apply to the same or different entries in the database. All tests in the guard are applied and MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise it executes f op (see item 3 below). 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or lookup operation, and applies to a single database entry. Two different operations in the list may apply to the same or different entries in the database. These operations are executed if guard evaluates to true. 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
func (*TxnRequest) GetCompare ¶
func (m *TxnRequest) GetCompare() []*Compare
func (*TxnRequest) GetFailure ¶
func (m *TxnRequest) GetFailure() []*RequestUnion
func (*TxnRequest) GetSuccess ¶
func (m *TxnRequest) GetSuccess() []*RequestUnion
func (*TxnRequest) Marshal ¶
func (m *TxnRequest) Marshal() (data []byte, err error)
func (*TxnRequest) ProtoMessage ¶
func (*TxnRequest) ProtoMessage()
func (*TxnRequest) Reset ¶
func (m *TxnRequest) Reset()
func (*TxnRequest) Size ¶
func (m *TxnRequest) Size() (n int)
func (*TxnRequest) String ¶
func (m *TxnRequest) String() string
func (*TxnRequest) Unmarshal ¶
func (m *TxnRequest) Unmarshal(data []byte) error
type TxnResponse ¶
type TxnResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"` Responses []*ResponseUnion `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"` }
func (*TxnResponse) GetHeader ¶
func (m *TxnResponse) GetHeader() *ResponseHeader
func (*TxnResponse) GetResponses ¶
func (m *TxnResponse) GetResponses() []*ResponseUnion
func (*TxnResponse) Marshal ¶
func (m *TxnResponse) Marshal() (data []byte, err error)
func (*TxnResponse) ProtoMessage ¶
func (*TxnResponse) ProtoMessage()
func (*TxnResponse) Reset ¶
func (m *TxnResponse) Reset()
func (*TxnResponse) Size ¶
func (m *TxnResponse) Size() (n int)
func (*TxnResponse) String ¶
func (m *TxnResponse) String() string
func (*TxnResponse) Unmarshal ¶
func (m *TxnResponse) Unmarshal(data []byte) error
type WatchCancelRequest ¶
type WatchCancelRequest struct {
WatchId int64 `protobuf:"varint,1,opt,name=watch_id,proto3" json:"watch_id,omitempty"`
}
func (*WatchCancelRequest) Marshal ¶
func (m *WatchCancelRequest) Marshal() (data []byte, err error)
func (*WatchCancelRequest) MarshalTo ¶
func (m *WatchCancelRequest) MarshalTo(data []byte) (int, error)
func (*WatchCancelRequest) ProtoMessage ¶
func (*WatchCancelRequest) ProtoMessage()
func (*WatchCancelRequest) Reset ¶
func (m *WatchCancelRequest) Reset()
func (*WatchCancelRequest) Size ¶
func (m *WatchCancelRequest) Size() (n int)
func (*WatchCancelRequest) String ¶
func (m *WatchCancelRequest) String() string
func (*WatchCancelRequest) Unmarshal ¶
func (m *WatchCancelRequest) Unmarshal(data []byte) error
type WatchClient ¶
type WatchClient interface { // Watch watches the events happening or happened. Both input and output // are stream. One watch rpc can watch for multiple keys or prefixs and // get a stream of events. The whole events history can be watched unless // compacted. Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) }
func NewWatchClient ¶
func NewWatchClient(cc *grpc.ClientConn) WatchClient
type WatchCreateRequest ¶
type WatchCreateRequest struct { // the key to be watched Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // the prefix to be watched. Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"` // start_revision is an optional revision (including) to watch from. No start_revision is "now". StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,proto3" json:"start_revision,omitempty"` }
func (*WatchCreateRequest) Marshal ¶
func (m *WatchCreateRequest) Marshal() (data []byte, err error)
func (*WatchCreateRequest) MarshalTo ¶
func (m *WatchCreateRequest) MarshalTo(data []byte) (int, error)
func (*WatchCreateRequest) ProtoMessage ¶
func (*WatchCreateRequest) ProtoMessage()
func (*WatchCreateRequest) Reset ¶
func (m *WatchCreateRequest) Reset()
func (*WatchCreateRequest) Size ¶
func (m *WatchCreateRequest) Size() (n int)
func (*WatchCreateRequest) String ¶
func (m *WatchCreateRequest) String() string
func (*WatchCreateRequest) Unmarshal ¶
func (m *WatchCreateRequest) Unmarshal(data []byte) error
type WatchRequest ¶
type WatchRequest struct { CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request" json:"create_request,omitempty"` CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request" json:"cancel_request,omitempty"` }
func (*WatchRequest) GetCancelRequest ¶
func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest
func (*WatchRequest) GetCreateRequest ¶
func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest
func (*WatchRequest) Marshal ¶
func (m *WatchRequest) Marshal() (data []byte, err error)
func (*WatchRequest) ProtoMessage ¶
func (*WatchRequest) ProtoMessage()
func (*WatchRequest) Reset ¶
func (m *WatchRequest) Reset()
func (*WatchRequest) Size ¶
func (m *WatchRequest) Size() (n int)
func (*WatchRequest) String ¶
func (m *WatchRequest) String() string
func (*WatchRequest) Unmarshal ¶
func (m *WatchRequest) Unmarshal(data []byte) error
type WatchResponse ¶
type WatchResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // watch_id is the ID of the watching the response sent to. WatchId int64 `protobuf:"varint,2,opt,name=watch_id,proto3" json:"watch_id,omitempty"` // If the response is for a create watch request, created is set to true. // Client should record the watch_id and prepare for receiving events for // that watching from the same stream. // All events sent to the created watching will attach with the same watch_id. Created bool `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"` // If the response is for a cancel watch request, cancel is set to true. // No further events will be sent to the canceled watching. Canceled bool `protobuf:"varint,4,opt,name=canceled,proto3" json:"canceled,omitempty"` // If a watching tries to watch at a compacted index, compacted will be set to true. // // This happens when creating a watching at a compacted revision or the watching cannot // catch up with the progress of the KV. // // Client should treat the watching as canceled and should not try to create any // watching with same start_revision again. Compacted bool `protobuf:"varint,5,opt,name=compacted,proto3" json:"compacted,omitempty"` Events []*storagepb.Event `protobuf:"bytes,11,rep,name=events" json:"events,omitempty"` }
func (*WatchResponse) GetEvents ¶
func (m *WatchResponse) GetEvents() []*storagepb.Event
func (*WatchResponse) GetHeader ¶
func (m *WatchResponse) GetHeader() *ResponseHeader
func (*WatchResponse) Marshal ¶
func (m *WatchResponse) Marshal() (data []byte, err error)
func (*WatchResponse) ProtoMessage ¶
func (*WatchResponse) ProtoMessage()
func (*WatchResponse) Reset ¶
func (m *WatchResponse) Reset()
func (*WatchResponse) Size ¶
func (m *WatchResponse) Size() (n int)
func (*WatchResponse) String ¶
func (m *WatchResponse) String() string
func (*WatchResponse) Unmarshal ¶
func (m *WatchResponse) Unmarshal(data []byte) error
type WatchServer ¶
type WatchServer interface { // Watch watches the events happening or happened. Both input and output // are stream. One watch rpc can watch for multiple keys or prefixs and // get a stream of events. The whole events history can be watched unless // compacted. Watch(Watch_WatchServer) error }
type Watch_WatchClient ¶
type Watch_WatchClient interface { Send(*WatchRequest) error Recv() (*WatchResponse, error) grpc.ClientStream }
type Watch_WatchServer ¶
type Watch_WatchServer interface { Send(*WatchResponse) error Recv() (*WatchRequest, error) grpc.ServerStream }