Documentation ¶
Overview ¶
Package cache defines a Cacher interfaces that can be implemented by any key value store system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var File_cache_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCacheServer ¶
func RegisterCacheServer(s *grpc.Server, srv CacheServer)
Types ¶
type CacheClient ¶
type CacheClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error) Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetReply, error) }
CacheClient is the client API for Cache service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCacheClient ¶
func NewCacheClient(cc grpc.ClientConnInterface) CacheClient
type CacheServer ¶
type CacheServer interface { Get(context.Context, *GetRequest) (*GetReply, error) Set(context.Context, *SetRequest) (*SetReply, error) }
CacheServer is the server API for Cache service.
type Cacher ¶ added in v0.9.0
type Cacher interface { Get(ctx context.Context, key string) (value []byte, err error) Set(ctx context.Context, key string, value []byte) error Close() error }
Cacher specifies an interface for remote clients connecting to the cache service.
type GetReply ¶
type GetReply struct { Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*GetReply) Descriptor
deprecated
func (*GetReply) ProtoMessage ¶
func (*GetReply) ProtoMessage()
func (*GetReply) ProtoReflect ¶ added in v0.9.0
func (x *GetReply) ProtoReflect() protoreflect.Message
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 ¶ added in v0.9.0
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type SetReply ¶
type SetReply struct {
// contains filtered or unexported fields
}
func (*SetReply) Descriptor
deprecated
func (*SetReply) ProtoMessage ¶
func (*SetReply) ProtoMessage()
func (*SetReply) ProtoReflect ¶ added in v0.9.0
func (x *SetReply) ProtoReflect() protoreflect.Message
type SetRequest ¶
type SetRequest 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 (*SetRequest) Descriptor
deprecated
func (*SetRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetRequest.ProtoReflect.Descriptor instead.
func (*SetRequest) GetKey ¶
func (x *SetRequest) GetKey() string
func (*SetRequest) GetValue ¶
func (x *SetRequest) GetValue() []byte
func (*SetRequest) ProtoMessage ¶
func (*SetRequest) ProtoMessage()
func (*SetRequest) ProtoReflect ¶ added in v0.9.0
func (x *SetRequest) ProtoReflect() protoreflect.Message
func (*SetRequest) Reset ¶
func (x *SetRequest) Reset()
func (*SetRequest) String ¶
func (x *SetRequest) String() string
type UnimplementedCacheServer ¶
type UnimplementedCacheServer struct { }
UnimplementedCacheServer can be embedded to have forward compatible implementations.
func (*UnimplementedCacheServer) Get ¶
func (*UnimplementedCacheServer) Get(context.Context, *GetRequest) (*GetReply, error)
func (*UnimplementedCacheServer) Set ¶
func (*UnimplementedCacheServer) Set(context.Context, *SetRequest) (*SetReply, error)
Click to show internal directories.
Click to hide internal directories.