Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_kv_proto protoreflect.FileDescriptor
var KV_ServiceDesc = grpc.ServiceDesc{ ServiceName: "kv.KV", HandlerType: (*KVServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _KV_Get_Handler, }, { MethodName: "Put", Handler: _KV_Put_Handler, }, { MethodName: "Dump", Handler: _KV_Dump_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "kv.proto", }
KV_ServiceDesc is the grpc.ServiceDesc for KV service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterKVServer ¶
func RegisterKVServer(s grpc.ServiceRegistrar, srv KVServer)
Types ¶
type DumpRequest ¶
type DumpRequest struct { RangeIdent uint64 `protobuf:"varint,1,opt,name=range_ident,json=rangeIdent,proto3" json:"range_ident,omitempty"` // contains filtered or unexported fields }
func (*DumpRequest) Descriptor
deprecated
func (*DumpRequest) Descriptor() ([]byte, []int)
Deprecated: Use DumpRequest.ProtoReflect.Descriptor instead.
func (*DumpRequest) GetRangeIdent ¶
func (x *DumpRequest) GetRangeIdent() uint64
func (*DumpRequest) ProtoMessage ¶
func (*DumpRequest) ProtoMessage()
func (*DumpRequest) ProtoReflect ¶
func (x *DumpRequest) ProtoReflect() protoreflect.Message
func (*DumpRequest) Reset ¶
func (x *DumpRequest) Reset()
func (*DumpRequest) String ¶
func (x *DumpRequest) String() string
type DumpResponse ¶
type DumpResponse struct { Pairs []*Pair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs,omitempty"` // contains filtered or unexported fields }
func (*DumpResponse) Descriptor
deprecated
func (*DumpResponse) Descriptor() ([]byte, []int)
Deprecated: Use DumpResponse.ProtoReflect.Descriptor instead.
func (*DumpResponse) GetPairs ¶
func (x *DumpResponse) GetPairs() []*Pair
func (*DumpResponse) ProtoMessage ¶
func (*DumpResponse) ProtoMessage()
func (*DumpResponse) ProtoReflect ¶
func (x *DumpResponse) ProtoReflect() protoreflect.Message
func (*DumpResponse) Reset ¶
func (x *DumpResponse) Reset()
func (*DumpResponse) String ¶
func (x *DumpResponse) String() string
type GetRequest ¶
type GetRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetKey ¶
func (x *GetRequest) GetKey() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetValue ¶
func (x *GetResponse) GetValue() []byte
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type KVClient ¶
type KVClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // Only used for nodes to transfer state. // Move this to a separate service so the proxy doesn't have to implement it. Dump(ctx context.Context, in *DumpRequest, opts ...grpc.CallOption) (*DumpResponse, error) }
KVClient is the client API for KV service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewKVClient ¶
func NewKVClient(cc grpc.ClientConnInterface) KVClient
type KVServer ¶
type KVServer interface { Get(context.Context, *GetRequest) (*GetResponse, error) Put(context.Context, *PutRequest) (*PutResponse, error) // Only used for nodes to transfer state. // Move this to a separate service so the proxy doesn't have to implement it. Dump(context.Context, *DumpRequest) (*DumpResponse, error) // contains filtered or unexported methods }
KVServer is the server API for KV service. All implementations must embed UnimplementedKVServer for forward compatibility
type Pair ¶
type Pair struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Pair) Descriptor
deprecated
func (*Pair) ProtoMessage ¶
func (*Pair) ProtoMessage()
func (*Pair) ProtoReflect ¶
func (x *Pair) ProtoReflect() protoreflect.Message
type PutRequest ¶
type PutRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*PutRequest) Descriptor
deprecated
func (*PutRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
func (*PutRequest) GetKey ¶
func (x *PutRequest) GetKey() string
func (*PutRequest) GetValue ¶
func (x *PutRequest) GetValue() []byte
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) ProtoReflect ¶
func (x *PutRequest) ProtoReflect() protoreflect.Message
func (*PutRequest) Reset ¶
func (x *PutRequest) Reset()
func (*PutRequest) String ¶
func (x *PutRequest) String() string
type PutResponse ¶
type PutResponse struct {
// contains filtered or unexported fields
}
func (*PutResponse) Descriptor
deprecated
func (*PutResponse) Descriptor() ([]byte, []int)
Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) ProtoReflect ¶
func (x *PutResponse) ProtoReflect() protoreflect.Message
func (*PutResponse) Reset ¶
func (x *PutResponse) Reset()
func (*PutResponse) String ¶
func (x *PutResponse) String() string
type UnimplementedKVServer ¶
type UnimplementedKVServer struct { }
UnimplementedKVServer must be embedded to have forward compatible implementations.
func (UnimplementedKVServer) Dump ¶
func (UnimplementedKVServer) Dump(context.Context, *DumpRequest) (*DumpResponse, error)
func (UnimplementedKVServer) Get ¶
func (UnimplementedKVServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (UnimplementedKVServer) Put ¶
func (UnimplementedKVServer) Put(context.Context, *PutRequest) (*PutResponse, error)
type UnsafeKVServer ¶
type UnsafeKVServer interface {
// contains filtered or unexported methods
}
UnsafeKVServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to KVServer will result in compilation errors.