Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCacheServiceServer(s grpc.ServiceRegistrar, srv CacheServiceServer)
- type CacheServiceClient
- type CacheServiceServer
- type CountRequest
- type CountResponse
- type GetResponse
- type KeyRequest
- type KeyValueDurationRequest
- func (*KeyValueDurationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *KeyValueDurationRequest) GetDuration() *durationpb.Duration
- func (x *KeyValueDurationRequest) GetKey() string
- func (x *KeyValueDurationRequest) GetToken() string
- func (x *KeyValueDurationRequest) GetValue() []byte
- func (*KeyValueDurationRequest) ProtoMessage()
- func (x *KeyValueDurationRequest) ProtoReflect() protoreflect.Message
- func (x *KeyValueDurationRequest) Reset()
- func (x *KeyValueDurationRequest) String() string
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetLogin() string
- func (x *LoginRequest) GetPassword() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type LoginResponse
- type UnimplementedCacheServiceServer
- func (UnimplementedCacheServiceServer) Add(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error)
- func (UnimplementedCacheServiceServer) Count(context.Context, *CountRequest) (*CountResponse, error)
- func (UnimplementedCacheServiceServer) Delete(context.Context, *KeyRequest) (*emptypb.Empty, error)
- func (UnimplementedCacheServiceServer) Get(context.Context, *KeyRequest) (*GetResponse, error)
- func (UnimplementedCacheServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
- func (UnimplementedCacheServiceServer) Replace(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error)
- func (UnimplementedCacheServiceServer) Set(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error)
- type UnsafeCacheServiceServer
Constants ¶
const ( CacheService_Login_FullMethodName = "/CacheService/Login" CacheService_Set_FullMethodName = "/CacheService/Set" CacheService_Add_FullMethodName = "/CacheService/Add" CacheService_Replace_FullMethodName = "/CacheService/Replace" CacheService_Get_FullMethodName = "/CacheService/Get" CacheService_Delete_FullMethodName = "/CacheService/Delete" CacheService_Count_FullMethodName = "/CacheService/Count" )
Variables ¶
var CacheService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "CacheService", HandlerType: (*CacheServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _CacheService_Login_Handler, }, { MethodName: "Set", Handler: _CacheService_Set_Handler, }, { MethodName: "Add", Handler: _CacheService_Add_Handler, }, { MethodName: "Replace", Handler: _CacheService_Replace_Handler, }, { MethodName: "Get", Handler: _CacheService_Get_Handler, }, { MethodName: "Delete", Handler: _CacheService_Delete_Handler, }, { MethodName: "Count", Handler: _CacheService_Count_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "grpcCache.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_grpcCache_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCacheServiceServer ¶
func RegisterCacheServiceServer(s grpc.ServiceRegistrar, srv CacheServiceServer)
Types ¶
type CacheServiceClient ¶
type CacheServiceClient interface { Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) Set(ctx context.Context, in *KeyValueDurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Add(ctx context.Context, in *KeyValueDurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Replace(ctx context.Context, in *KeyValueDurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Get(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*GetResponse, error) Delete(ctx context.Context, in *KeyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Count(ctx context.Context, in *CountRequest, opts ...grpc.CallOption) (*CountResponse, 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 { Login(context.Context, *LoginRequest) (*LoginResponse, error) Set(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error) Add(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error) Replace(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error) Get(context.Context, *KeyRequest) (*GetResponse, error) Delete(context.Context, *KeyRequest) (*emptypb.Empty, error) Count(context.Context, *CountRequest) (*CountResponse, error) // contains filtered or unexported methods }
CacheServiceServer is the server API for CacheService service. All implementations must embed UnimplementedCacheServiceServer for forward compatibility
type CountRequest ¶
type CountRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*CountRequest) Descriptor
deprecated
func (*CountRequest) Descriptor() ([]byte, []int)
Deprecated: Use CountRequest.ProtoReflect.Descriptor instead.
func (*CountRequest) GetToken ¶
func (x *CountRequest) GetToken() string
func (*CountRequest) ProtoMessage ¶
func (*CountRequest) ProtoMessage()
func (*CountRequest) ProtoReflect ¶
func (x *CountRequest) ProtoReflect() protoreflect.Message
func (*CountRequest) Reset ¶
func (x *CountRequest) Reset()
func (*CountRequest) String ¶
func (x *CountRequest) String() string
type CountResponse ¶
type CountResponse struct { Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*CountResponse) Descriptor
deprecated
func (*CountResponse) Descriptor() ([]byte, []int)
Deprecated: Use CountResponse.ProtoReflect.Descriptor instead.
func (*CountResponse) GetCount ¶
func (x *CountResponse) GetCount() int64
func (*CountResponse) ProtoMessage ¶
func (*CountResponse) ProtoMessage()
func (*CountResponse) ProtoReflect ¶
func (x *CountResponse) ProtoReflect() protoreflect.Message
func (*CountResponse) Reset ¶
func (x *CountResponse) Reset()
func (*CountResponse) String ¶
func (x *CountResponse) String() string
type GetResponse ¶
type GetResponse struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetFound ¶
func (x *GetResponse) GetFound() bool
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 KeyRequest ¶ added in v0.1.2
type KeyRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*KeyRequest) Descriptor
deprecated
added in
v0.1.2
func (*KeyRequest) Descriptor() ([]byte, []int)
Deprecated: Use KeyRequest.ProtoReflect.Descriptor instead.
func (*KeyRequest) GetKey ¶ added in v0.1.2
func (x *KeyRequest) GetKey() string
func (*KeyRequest) GetToken ¶ added in v0.1.2
func (x *KeyRequest) GetToken() string
func (*KeyRequest) ProtoMessage ¶ added in v0.1.2
func (*KeyRequest) ProtoMessage()
func (*KeyRequest) ProtoReflect ¶ added in v0.1.2
func (x *KeyRequest) ProtoReflect() protoreflect.Message
func (*KeyRequest) Reset ¶ added in v0.1.2
func (x *KeyRequest) Reset()
func (*KeyRequest) String ¶ added in v0.1.2
func (x *KeyRequest) String() string
type KeyValueDurationRequest ¶ added in v0.1.2
type KeyValueDurationRequest 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"` Duration *durationpb.Duration `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*KeyValueDurationRequest) Descriptor
deprecated
added in
v0.1.2
func (*KeyValueDurationRequest) Descriptor() ([]byte, []int)
Deprecated: Use KeyValueDurationRequest.ProtoReflect.Descriptor instead.
func (*KeyValueDurationRequest) GetDuration ¶ added in v0.1.2
func (x *KeyValueDurationRequest) GetDuration() *durationpb.Duration
func (*KeyValueDurationRequest) GetKey ¶ added in v0.1.2
func (x *KeyValueDurationRequest) GetKey() string
func (*KeyValueDurationRequest) GetToken ¶ added in v0.1.2
func (x *KeyValueDurationRequest) GetToken() string
func (*KeyValueDurationRequest) GetValue ¶ added in v0.1.2
func (x *KeyValueDurationRequest) GetValue() []byte
func (*KeyValueDurationRequest) ProtoMessage ¶ added in v0.1.2
func (*KeyValueDurationRequest) ProtoMessage()
func (*KeyValueDurationRequest) ProtoReflect ¶ added in v0.1.2
func (x *KeyValueDurationRequest) ProtoReflect() protoreflect.Message
func (*KeyValueDurationRequest) Reset ¶ added in v0.1.2
func (x *KeyValueDurationRequest) Reset()
func (*KeyValueDurationRequest) String ¶ added in v0.1.2
func (x *KeyValueDurationRequest) String() string
type LoginRequest ¶
type LoginRequest struct { Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetLogin ¶
func (x *LoginRequest) GetLogin() string
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type LoginResponse ¶
type LoginResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetToken ¶
func (x *LoginResponse) GetToken() string
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
type UnimplementedCacheServiceServer ¶
type UnimplementedCacheServiceServer struct { }
UnimplementedCacheServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedCacheServiceServer) Add ¶ added in v0.1.2
func (UnimplementedCacheServiceServer) Add(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error)
func (UnimplementedCacheServiceServer) Count ¶
func (UnimplementedCacheServiceServer) Count(context.Context, *CountRequest) (*CountResponse, error)
func (UnimplementedCacheServiceServer) Delete ¶
func (UnimplementedCacheServiceServer) Delete(context.Context, *KeyRequest) (*emptypb.Empty, error)
func (UnimplementedCacheServiceServer) Get ¶
func (UnimplementedCacheServiceServer) Get(context.Context, *KeyRequest) (*GetResponse, error)
func (UnimplementedCacheServiceServer) Login ¶
func (UnimplementedCacheServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
func (UnimplementedCacheServiceServer) Replace ¶ added in v0.1.2
func (UnimplementedCacheServiceServer) Replace(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error)
func (UnimplementedCacheServiceServer) Set ¶
func (UnimplementedCacheServiceServer) Set(context.Context, *KeyValueDurationRequest) (*emptypb.Empty, error)
type UnsafeCacheServiceServer ¶
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.