Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CacheService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cache.CacheService", HandlerType: (*CacheServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _CacheService_Get_Handler, }, { MethodName: "Put", Handler: _CacheService_Put_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cache/cache_service.proto", }
CacheService_ServiceDesc is the grpc.ServiceDesc for CacheService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_cache_cache_proto protoreflect.FileDescriptor
var File_cache_cache_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCacheServiceServer ¶
func RegisterCacheServiceServer(s grpc.ServiceRegistrar, srv CacheServiceServer)
Types ¶
type CacheServiceClient ¶
type CacheServiceClient interface { Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*GetResp, error) Put(ctx context.Context, in *PutReq, opts ...grpc.CallOption) (*PutResp, error) }
CacheServiceClient is the client API for CacheService 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 NewCacheServiceClient ¶
func NewCacheServiceClient(cc grpc.ClientConnInterface) CacheServiceClient
type CacheServiceServer ¶
type CacheServiceServer interface { Get(context.Context, *GetReq) (*GetResp, error) Put(context.Context, *PutReq) (*PutResp, error) // contains filtered or unexported methods }
CacheServiceServer is the server API for CacheService service. All implementations must embed UnimplementedCacheServiceServer for forward compatibility
type GetReq ¶
type GetReq struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Fast bool `protobuf:"varint,2,opt,name=fast,proto3" json:"fast,omitempty"` // contains filtered or unexported fields }
func (*GetReq) Descriptor
deprecated
func (*GetReq) ProtoMessage ¶
func (*GetReq) ProtoMessage()
func (*GetReq) ProtoReflect ¶ added in v0.0.12
func (x *GetReq) ProtoReflect() protoreflect.Message
type GetResp ¶
type GetResp struct { Kv *KV `protobuf:"bytes,1,opt,name=kv,proto3" json:"kv,omitempty"` InMemory bool `protobuf:"varint,2,opt,name=in_memory,json=inMemory,proto3" json:"in_memory,omitempty"` // contains filtered or unexported fields }
func (*GetResp) Descriptor
deprecated
func (*GetResp) GetInMemory ¶
func (*GetResp) ProtoMessage ¶
func (*GetResp) ProtoMessage()
func (*GetResp) ProtoReflect ¶ added in v0.0.12
func (x *GetResp) ProtoReflect() protoreflect.Message
type KV ¶
type KV 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 (*KV) Descriptor
deprecated
func (*KV) ProtoMessage ¶
func (*KV) ProtoMessage()
func (*KV) ProtoReflect ¶ added in v0.0.12
func (x *KV) ProtoReflect() protoreflect.Message
type PutReq ¶
type PutReq struct { Kv *KV `protobuf:"bytes,1,opt,name=kv,proto3" json:"kv,omitempty"` WriteBack bool `protobuf:"varint,2,opt,name=write_back,json=writeBack,proto3" json:"write_back,omitempty"` // contains filtered or unexported fields }
func (*PutReq) Descriptor
deprecated
func (*PutReq) GetWriteBack ¶
func (*PutReq) ProtoMessage ¶
func (*PutReq) ProtoMessage()
func (*PutReq) ProtoReflect ¶ added in v0.0.12
func (x *PutReq) ProtoReflect() protoreflect.Message
type PutResp ¶
type PutResp struct {
// contains filtered or unexported fields
}
func (*PutResp) Descriptor
deprecated
func (*PutResp) ProtoMessage ¶
func (*PutResp) ProtoMessage()
func (*PutResp) ProtoReflect ¶ added in v0.0.12
func (x *PutResp) ProtoReflect() protoreflect.Message
type UnimplementedCacheServiceServer ¶ added in v0.0.5
type UnimplementedCacheServiceServer struct { }
UnimplementedCacheServiceServer must be embedded to have forward compatible implementations.
type UnsafeCacheServiceServer ¶ added in v0.0.18
type UnsafeCacheServiceServer interface {
// contains filtered or unexported methods
}
UnsafeCacheServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CacheServiceServer will result in compilation errors.