Documentation ¶
Index ¶
- Variables
- func RegisterKVStoreServer(s grpc.ServiceRegistrar, srv KVStoreServer)
- type CommonReply
- func (*CommonReply) Descriptor() ([]byte, []int)deprecated
- func (x *CommonReply) GetCode() ErrCode
- func (x *CommonReply) GetMsg() string
- func (x *CommonReply) GetSize() int64
- func (x *CommonReply) GetSuccess() bool
- func (x *CommonReply) GetValue() []byte
- func (*CommonReply) ProtoMessage()
- func (x *CommonReply) ProtoReflect() protoreflect.Message
- func (x *CommonReply) Reset()
- func (x *CommonReply) String() string
- type CommonRequest
- func (*CommonRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CommonRequest) GetKey() string
- func (x *CommonRequest) GetValue() []byte
- func (*CommonRequest) ProtoMessage()
- func (x *CommonRequest) ProtoReflect() protoreflect.Message
- func (x *CommonRequest) Reset()
- func (x *CommonRequest) String() string
- type DataStore
- func (d *DataStore) Batch() (ds.Batch, error)
- func (d *DataStore) Close() error
- func (d *DataStore) Delete(k ds.Key) error
- func (d *DataStore) Get(k ds.Key) ([]byte, error)
- func (d *DataStore) GetSize(k ds.Key) (int, error)
- func (d *DataStore) Has(k ds.Key) (bool, error)
- func (d *DataStore) Put(k ds.Key, value []byte) error
- func (d *DataStore) Query(q dsq.Query) (dsq.Results, error)
- func (d *DataStore) Sync(ds.Key) error
- type ErrCode
- type KVStoreClient
- type KVStoreServer
- type KVStore_QueryClient
- type KVStore_QueryServer
- type QueryReply
- func (*QueryReply) Descriptor() ([]byte, []int)deprecated
- func (x *QueryReply) GetCode() ErrCode
- func (x *QueryReply) GetMsg() string
- func (x *QueryReply) GetRes() []byte
- func (*QueryReply) ProtoMessage()
- func (x *QueryReply) ProtoReflect() protoreflect.Message
- func (x *QueryReply) Reset()
- func (x *QueryReply) String() string
- type QueryRequest
- type UnimplementedKVStoreServer
- func (UnimplementedKVStoreServer) Delete(context.Context, *CommonRequest) (*CommonReply, error)
- func (UnimplementedKVStoreServer) Get(context.Context, *CommonRequest) (*CommonReply, error)
- func (UnimplementedKVStoreServer) GetSize(context.Context, *CommonRequest) (*CommonReply, error)
- func (UnimplementedKVStoreServer) Has(context.Context, *CommonRequest) (*CommonReply, error)
- func (UnimplementedKVStoreServer) Put(context.Context, *CommonRequest) (*CommonReply, error)
- func (UnimplementedKVStoreServer) Query(*QueryRequest, KVStore_QueryServer) error
- type UnsafeKVStoreServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrCode_name = map[int32]string{ 0: "None", 1: "ErrNotFound", 100: "Others", } ErrCode_value = map[string]int32{ "None": 0, "ErrNotFound": 1, "Others": 100, } )
Enum value maps for ErrCode.
var File_store_proto protoreflect.FileDescriptor
var KVStore_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dsrpc.KVStore", HandlerType: (*KVStoreServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Put", Handler: _KVStore_Put_Handler, }, { MethodName: "Delete", Handler: _KVStore_Delete_Handler, }, { MethodName: "Get", Handler: _KVStore_Get_Handler, }, { MethodName: "Has", Handler: _KVStore_Has_Handler, }, { MethodName: "GetSize", Handler: _KVStore_GetSize_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Query", Handler: _KVStore_Query_Handler, ServerStreams: true, }, }, Metadata: "store.proto", }
KVStore_ServiceDesc is the grpc.ServiceDesc for KVStore service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterKVStoreServer ¶
func RegisterKVStoreServer(s grpc.ServiceRegistrar, srv KVStoreServer)
Types ¶
type CommonReply ¶
type CommonReply struct { Code ErrCode `protobuf:"varint,1,opt,name=code,proto3,enum=dsrpc.ErrCode" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Success bool `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"` Size int64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` // contains filtered or unexported fields }
func (*CommonReply) Descriptor
deprecated
func (*CommonReply) Descriptor() ([]byte, []int)
Deprecated: Use CommonReply.ProtoReflect.Descriptor instead.
func (*CommonReply) GetCode ¶
func (x *CommonReply) GetCode() ErrCode
func (*CommonReply) GetMsg ¶
func (x *CommonReply) GetMsg() string
func (*CommonReply) GetSize ¶
func (x *CommonReply) GetSize() int64
func (*CommonReply) GetSuccess ¶
func (x *CommonReply) GetSuccess() bool
func (*CommonReply) GetValue ¶
func (x *CommonReply) GetValue() []byte
func (*CommonReply) ProtoMessage ¶
func (*CommonReply) ProtoMessage()
func (*CommonReply) ProtoReflect ¶
func (x *CommonReply) ProtoReflect() protoreflect.Message
func (*CommonReply) Reset ¶
func (x *CommonReply) Reset()
func (*CommonReply) String ¶
func (x *CommonReply) String() string
type CommonRequest ¶
type CommonRequest 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 (*CommonRequest) Descriptor
deprecated
func (*CommonRequest) Descriptor() ([]byte, []int)
Deprecated: Use CommonRequest.ProtoReflect.Descriptor instead.
func (*CommonRequest) GetKey ¶
func (x *CommonRequest) GetKey() string
func (*CommonRequest) GetValue ¶
func (x *CommonRequest) GetValue() []byte
func (*CommonRequest) ProtoMessage ¶
func (*CommonRequest) ProtoMessage()
func (*CommonRequest) ProtoReflect ¶
func (x *CommonRequest) ProtoReflect() protoreflect.Message
func (*CommonRequest) Reset ¶
func (x *CommonRequest) Reset()
func (*CommonRequest) String ¶
func (x *CommonRequest) String() string
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
func NewDataStore ¶
func NewDataStore(client KVStoreClient) (*DataStore, error)
type ErrCode ¶
type ErrCode int32
func (ErrCode) Descriptor ¶
func (ErrCode) Descriptor() protoreflect.EnumDescriptor
func (ErrCode) EnumDescriptor
deprecated
func (ErrCode) Number ¶
func (x ErrCode) Number() protoreflect.EnumNumber
func (ErrCode) Type ¶
func (ErrCode) Type() protoreflect.EnumType
type KVStoreClient ¶
type KVStoreClient interface { Put(ctx context.Context, in *CommonRequest, opts ...grpc.CallOption) (*CommonReply, error) Delete(ctx context.Context, in *CommonRequest, opts ...grpc.CallOption) (*CommonReply, error) Get(ctx context.Context, in *CommonRequest, opts ...grpc.CallOption) (*CommonReply, error) Has(ctx context.Context, in *CommonRequest, opts ...grpc.CallOption) (*CommonReply, error) GetSize(ctx context.Context, in *CommonRequest, opts ...grpc.CallOption) (*CommonReply, error) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (KVStore_QueryClient, error) }
KVStoreClient is the client API for KVStore 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 NewKVStoreClient ¶
func NewKVStoreClient(cc grpc.ClientConnInterface) KVStoreClient
type KVStoreServer ¶
type KVStoreServer interface { Put(context.Context, *CommonRequest) (*CommonReply, error) Delete(context.Context, *CommonRequest) (*CommonReply, error) Get(context.Context, *CommonRequest) (*CommonReply, error) Has(context.Context, *CommonRequest) (*CommonReply, error) GetSize(context.Context, *CommonRequest) (*CommonReply, error) Query(*QueryRequest, KVStore_QueryServer) error // contains filtered or unexported methods }
KVStoreServer is the server API for KVStore service. All implementations must embed UnimplementedKVStoreServer for forward compatibility
type KVStore_QueryClient ¶
type KVStore_QueryClient interface { Recv() (*QueryReply, error) grpc.ClientStream }
type KVStore_QueryServer ¶
type KVStore_QueryServer interface { Send(*QueryReply) error grpc.ServerStream }
type QueryReply ¶
type QueryReply struct { Code ErrCode `protobuf:"varint,1,opt,name=code,proto3,enum=dsrpc.ErrCode" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Res []byte `protobuf:"bytes,3,opt,name=res,proto3" json:"res,omitempty"` // contains filtered or unexported fields }
func (*QueryReply) Descriptor
deprecated
func (*QueryReply) Descriptor() ([]byte, []int)
Deprecated: Use QueryReply.ProtoReflect.Descriptor instead.
func (*QueryReply) GetCode ¶
func (x *QueryReply) GetCode() ErrCode
func (*QueryReply) GetMsg ¶
func (x *QueryReply) GetMsg() string
func (*QueryReply) GetRes ¶
func (x *QueryReply) GetRes() []byte
func (*QueryReply) ProtoMessage ¶
func (*QueryReply) ProtoMessage()
func (*QueryReply) ProtoReflect ¶
func (x *QueryReply) ProtoReflect() protoreflect.Message
func (*QueryReply) Reset ¶
func (x *QueryReply) Reset()
func (*QueryReply) String ¶
func (x *QueryReply) String() string
type QueryRequest ¶
type QueryRequest struct { Q []byte `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty"` // contains filtered or unexported fields }
func (*QueryRequest) Descriptor
deprecated
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetQ ¶
func (x *QueryRequest) GetQ() []byte
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶
func (x *QueryRequest) String() string
type UnimplementedKVStoreServer ¶
type UnimplementedKVStoreServer struct { }
UnimplementedKVStoreServer must be embedded to have forward compatible implementations.
func (UnimplementedKVStoreServer) Delete ¶
func (UnimplementedKVStoreServer) Delete(context.Context, *CommonRequest) (*CommonReply, error)
func (UnimplementedKVStoreServer) Get ¶
func (UnimplementedKVStoreServer) Get(context.Context, *CommonRequest) (*CommonReply, error)
func (UnimplementedKVStoreServer) GetSize ¶
func (UnimplementedKVStoreServer) GetSize(context.Context, *CommonRequest) (*CommonReply, error)
func (UnimplementedKVStoreServer) Has ¶
func (UnimplementedKVStoreServer) Has(context.Context, *CommonRequest) (*CommonReply, error)
func (UnimplementedKVStoreServer) Put ¶
func (UnimplementedKVStoreServer) Put(context.Context, *CommonRequest) (*CommonReply, error)
func (UnimplementedKVStoreServer) Query ¶
func (UnimplementedKVStoreServer) Query(*QueryRequest, KVStore_QueryServer) error
type UnsafeKVStoreServer ¶
type UnsafeKVStoreServer interface {
// contains filtered or unexported methods
}
UnsafeKVStoreServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to KVStoreServer will result in compilation errors.