Documentation ¶
Index ¶
- Variables
- func RegisterPeerServer(s grpc.ServiceRegistrar, srv PeerServer)
- func RegisterSKVServer(s grpc.ServiceRegistrar, srv SKVServer)
- type DelReply
- type DelRequest
- type GetMetaReply
- type GetMetaReply_Server
- func (*GetMetaReply_Server) Descriptor() ([]byte, []int)deprecated
- func (x *GetMetaReply_Server) GetAddress() string
- func (x *GetMetaReply_Server) GetLeader() bool
- func (x *GetMetaReply_Server) GetRpcAddress() string
- func (x *GetMetaReply_Server) GetServerID() string
- func (x *GetMetaReply_Server) GetState() string
- func (*GetMetaReply_Server) ProtoMessage()
- func (x *GetMetaReply_Server) ProtoReflect() protoreflect.Message
- func (x *GetMetaReply_Server) Reset()
- func (x *GetMetaReply_Server) String() string
- type GetMetaRequest
- type GetReply
- type GetRequest
- type KeyValuePair
- func (*KeyValuePair) Descriptor() ([]byte, []int)deprecated
- func (x *KeyValuePair) GetKey() string
- func (x *KeyValuePair) GetValue() []byte
- func (*KeyValuePair) ProtoMessage()
- func (x *KeyValuePair) ProtoReflect() protoreflect.Message
- func (x *KeyValuePair) Reset()
- func (x *KeyValuePair) String() string
- type PeerClient
- type PeerReply
- type PeerRequest
- func (*PeerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PeerRequest) GetAddress() string
- func (x *PeerRequest) GetPrevIndex() uint64
- func (x *PeerRequest) GetServerID() string
- func (*PeerRequest) ProtoMessage()
- func (x *PeerRequest) ProtoReflect() protoreflect.Message
- func (x *PeerRequest) Reset()
- func (x *PeerRequest) String() string
- type PeerServer
- type PutReply
- type ReadLevel
- type SKVClient
- type SKVServer
- type SKV_ScanClient
- type SKV_ScanServer
- type ScanOption
- func (*ScanOption) Descriptor() ([]byte, []int)deprecated
- func (x *ScanOption) GetLevel() ReadLevel
- func (x *ScanOption) GetLimits() int32
- func (x *ScanOption) GetPrefix() string
- func (*ScanOption) ProtoMessage()
- func (x *ScanOption) ProtoReflect() protoreflect.Message
- func (x *ScanOption) Reset()
- func (x *ScanOption) String() string
- type UnimplementedPeerServer
- type UnimplementedSKVServer
- func (UnimplementedSKVServer) Del(context.Context, *DelRequest) (*DelReply, error)
- func (UnimplementedSKVServer) Get(context.Context, *GetRequest) (*GetReply, error)
- func (UnimplementedSKVServer) GetMeta(context.Context, *GetMetaRequest) (*GetMetaReply, error)
- func (UnimplementedSKVServer) Put(context.Context, *KeyValuePair) (*PutReply, error)
- func (UnimplementedSKVServer) Scan(*ScanOption, SKV_ScanServer) error
- type UnsafePeerServer
- type UnsafeSKVServer
Constants ¶
This section is empty.
Variables ¶
var ( ReadLevel_name = map[int32]string{ 0: "DefaultRead", 1: "LinearRead", 2: "StaleRead", } ReadLevel_value = map[string]int32{ "DefaultRead": 0, "LinearRead": 1, "StaleRead": 2, } )
Enum value maps for ReadLevel.
var File_internal_pkg_rpc_service_proto protoreflect.FileDescriptor
var Peer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpc.Peer", HandlerType: (*PeerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Join", Handler: _Peer_Join_Handler, }, { MethodName: "Quit", Handler: _Peer_Quit_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "internal/pkg/rpc/service.proto", }
Peer_ServiceDesc is the grpc.ServiceDesc for Peer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var SKV_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpc.SKV", HandlerType: (*SKVServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _SKV_Get_Handler, }, { MethodName: "Del", Handler: _SKV_Del_Handler, }, { MethodName: "Put", Handler: _SKV_Put_Handler, }, { MethodName: "GetMeta", Handler: _SKV_GetMeta_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Scan", Handler: _SKV_Scan_Handler, ServerStreams: true, }, }, Metadata: "internal/pkg/rpc/service.proto", }
SKV_ServiceDesc is the grpc.ServiceDesc for SKV service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPeerServer ¶
func RegisterPeerServer(s grpc.ServiceRegistrar, srv PeerServer)
func RegisterSKVServer ¶
func RegisterSKVServer(s grpc.ServiceRegistrar, srv SKVServer)
Types ¶
type DelReply ¶
type DelReply struct { Error int32 `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*DelReply) Descriptor
deprecated
func (*DelReply) ProtoMessage ¶
func (*DelReply) ProtoMessage()
func (*DelReply) ProtoReflect ¶
func (x *DelReply) ProtoReflect() protoreflect.Message
type DelRequest ¶
type DelRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
func (*DelRequest) Descriptor
deprecated
func (*DelRequest) Descriptor() ([]byte, []int)
Deprecated: Use DelRequest.ProtoReflect.Descriptor instead.
func (*DelRequest) GetKey ¶
func (x *DelRequest) GetKey() string
func (*DelRequest) ProtoMessage ¶
func (*DelRequest) ProtoMessage()
func (*DelRequest) ProtoReflect ¶
func (x *DelRequest) ProtoReflect() protoreflect.Message
func (*DelRequest) Reset ¶
func (x *DelRequest) Reset()
func (*DelRequest) String ¶
func (x *DelRequest) String() string
type GetMetaReply ¶
type GetMetaReply struct { Servers []*GetMetaReply_Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"` // contains filtered or unexported fields }
func (*GetMetaReply) Descriptor
deprecated
func (*GetMetaReply) Descriptor() ([]byte, []int)
Deprecated: Use GetMetaReply.ProtoReflect.Descriptor instead.
func (*GetMetaReply) GetServers ¶
func (x *GetMetaReply) GetServers() []*GetMetaReply_Server
func (*GetMetaReply) ProtoMessage ¶
func (*GetMetaReply) ProtoMessage()
func (*GetMetaReply) ProtoReflect ¶
func (x *GetMetaReply) ProtoReflect() protoreflect.Message
func (*GetMetaReply) Reset ¶
func (x *GetMetaReply) Reset()
func (*GetMetaReply) String ¶
func (x *GetMetaReply) String() string
type GetMetaReply_Server ¶
type GetMetaReply_Server struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` ServerID string `protobuf:"bytes,2,opt,name=serverID,proto3" json:"serverID,omitempty"` Leader bool `protobuf:"varint,3,opt,name=leader,proto3" json:"leader,omitempty"` State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` RpcAddress string `protobuf:"bytes,5,opt,name=rpcAddress,proto3" json:"rpcAddress,omitempty"` // contains filtered or unexported fields }
func (*GetMetaReply_Server) Descriptor
deprecated
func (*GetMetaReply_Server) Descriptor() ([]byte, []int)
Deprecated: Use GetMetaReply_Server.ProtoReflect.Descriptor instead.
func (*GetMetaReply_Server) GetAddress ¶
func (x *GetMetaReply_Server) GetAddress() string
func (*GetMetaReply_Server) GetLeader ¶
func (x *GetMetaReply_Server) GetLeader() bool
func (*GetMetaReply_Server) GetRpcAddress ¶
func (x *GetMetaReply_Server) GetRpcAddress() string
func (*GetMetaReply_Server) GetServerID ¶
func (x *GetMetaReply_Server) GetServerID() string
func (*GetMetaReply_Server) GetState ¶
func (x *GetMetaReply_Server) GetState() string
func (*GetMetaReply_Server) ProtoMessage ¶
func (*GetMetaReply_Server) ProtoMessage()
func (*GetMetaReply_Server) ProtoReflect ¶
func (x *GetMetaReply_Server) ProtoReflect() protoreflect.Message
func (*GetMetaReply_Server) Reset ¶
func (x *GetMetaReply_Server) Reset()
func (*GetMetaReply_Server) String ¶
func (x *GetMetaReply_Server) String() string
type GetMetaRequest ¶
type GetMetaRequest struct { Condition string `protobuf:"bytes,1,opt,name=condition,proto3" json:"condition,omitempty"` // contains filtered or unexported fields }
func (*GetMetaRequest) Descriptor
deprecated
func (*GetMetaRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMetaRequest.ProtoReflect.Descriptor instead.
func (*GetMetaRequest) GetCondition ¶
func (x *GetMetaRequest) GetCondition() string
func (*GetMetaRequest) ProtoMessage ¶
func (*GetMetaRequest) ProtoMessage()
func (*GetMetaRequest) ProtoReflect ¶
func (x *GetMetaRequest) ProtoReflect() protoreflect.Message
func (*GetMetaRequest) Reset ¶
func (x *GetMetaRequest) Reset()
func (*GetMetaRequest) String ¶
func (x *GetMetaRequest) String() string
type GetReply ¶
type GetReply struct { Value []byte `protobuf:"bytes,1,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 ¶
func (x *GetReply) ProtoReflect() protoreflect.Message
type GetRequest ¶
type GetRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Level ReadLevel `protobuf:"varint,2,opt,name=level,proto3,enum=rpc.ReadLevel" json:"level,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) GetLevel ¶
func (x *GetRequest) GetLevel() ReadLevel
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 KeyValuePair ¶
type KeyValuePair 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 (*KeyValuePair) Descriptor
deprecated
func (*KeyValuePair) Descriptor() ([]byte, []int)
Deprecated: Use KeyValuePair.ProtoReflect.Descriptor instead.
func (*KeyValuePair) GetKey ¶
func (x *KeyValuePair) GetKey() string
func (*KeyValuePair) GetValue ¶
func (x *KeyValuePair) GetValue() []byte
func (*KeyValuePair) ProtoMessage ¶
func (*KeyValuePair) ProtoMessage()
func (*KeyValuePair) ProtoReflect ¶
func (x *KeyValuePair) ProtoReflect() protoreflect.Message
func (*KeyValuePair) Reset ¶
func (x *KeyValuePair) Reset()
func (*KeyValuePair) String ¶
func (x *KeyValuePair) String() string
type PeerClient ¶
type PeerClient interface { Join(ctx context.Context, in *PeerRequest, opts ...grpc.CallOption) (*PeerReply, error) Quit(ctx context.Context, in *PeerRequest, opts ...grpc.CallOption) (*PeerReply, error) }
PeerClient is the client API for Peer 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 NewPeerClient ¶
func NewPeerClient(cc grpc.ClientConnInterface) PeerClient
type PeerReply ¶
type PeerReply struct {
// contains filtered or unexported fields
}
func (*PeerReply) Descriptor
deprecated
func (*PeerReply) ProtoMessage ¶
func (*PeerReply) ProtoMessage()
func (*PeerReply) ProtoReflect ¶
func (x *PeerReply) ProtoReflect() protoreflect.Message
type PeerRequest ¶
type PeerRequest struct { ServerID string `protobuf:"bytes,1,opt,name=serverID,proto3" json:"serverID,omitempty"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` PrevIndex uint64 `protobuf:"varint,3,opt,name=prevIndex,proto3" json:"prevIndex,omitempty"` // contains filtered or unexported fields }
func (*PeerRequest) Descriptor
deprecated
func (*PeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use PeerRequest.ProtoReflect.Descriptor instead.
func (*PeerRequest) GetAddress ¶
func (x *PeerRequest) GetAddress() string
func (*PeerRequest) GetPrevIndex ¶
func (x *PeerRequest) GetPrevIndex() uint64
func (*PeerRequest) GetServerID ¶
func (x *PeerRequest) GetServerID() string
func (*PeerRequest) ProtoMessage ¶
func (*PeerRequest) ProtoMessage()
func (*PeerRequest) ProtoReflect ¶
func (x *PeerRequest) ProtoReflect() protoreflect.Message
func (*PeerRequest) Reset ¶
func (x *PeerRequest) Reset()
func (*PeerRequest) String ¶
func (x *PeerRequest) String() string
type PeerServer ¶
type PeerServer interface { Join(context.Context, *PeerRequest) (*PeerReply, error) Quit(context.Context, *PeerRequest) (*PeerReply, error) // contains filtered or unexported methods }
PeerServer is the server API for Peer service. All implementations must embed UnimplementedPeerServer for forward compatibility
type PutReply ¶
type PutReply struct { Error int32 `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*PutReply) Descriptor
deprecated
func (*PutReply) ProtoMessage ¶
func (*PutReply) ProtoMessage()
func (*PutReply) ProtoReflect ¶
func (x *PutReply) ProtoReflect() protoreflect.Message
type ReadLevel ¶
type ReadLevel int32
func (ReadLevel) Descriptor ¶
func (ReadLevel) Descriptor() protoreflect.EnumDescriptor
func (ReadLevel) EnumDescriptor
deprecated
func (ReadLevel) Number ¶
func (x ReadLevel) Number() protoreflect.EnumNumber
func (ReadLevel) Type ¶
func (ReadLevel) Type() protoreflect.EnumType
type SKVClient ¶
type SKVClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error) Del(ctx context.Context, in *DelRequest, opts ...grpc.CallOption) (*DelReply, error) Put(ctx context.Context, in *KeyValuePair, opts ...grpc.CallOption) (*PutReply, error) Scan(ctx context.Context, in *ScanOption, opts ...grpc.CallOption) (SKV_ScanClient, error) GetMeta(ctx context.Context, in *GetMetaRequest, opts ...grpc.CallOption) (*GetMetaReply, error) }
SKVClient is the client API for SKV 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 NewSKVClient ¶
func NewSKVClient(cc grpc.ClientConnInterface) SKVClient
type SKVServer ¶
type SKVServer interface { Get(context.Context, *GetRequest) (*GetReply, error) Del(context.Context, *DelRequest) (*DelReply, error) Put(context.Context, *KeyValuePair) (*PutReply, error) Scan(*ScanOption, SKV_ScanServer) error GetMeta(context.Context, *GetMetaRequest) (*GetMetaReply, error) // contains filtered or unexported methods }
SKVServer is the server API for SKV service. All implementations must embed UnimplementedSKVServer for forward compatibility
type SKV_ScanClient ¶
type SKV_ScanClient interface { Recv() (*KeyValuePair, error) grpc.ClientStream }
type SKV_ScanServer ¶
type SKV_ScanServer interface { Send(*KeyValuePair) error grpc.ServerStream }
type ScanOption ¶
type ScanOption struct { Limits int32 `protobuf:"varint,1,opt,name=limits,proto3" json:"limits,omitempty"` Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"` Level ReadLevel `protobuf:"varint,3,opt,name=level,proto3,enum=rpc.ReadLevel" json:"level,omitempty"` // contains filtered or unexported fields }
func (*ScanOption) Descriptor
deprecated
func (*ScanOption) Descriptor() ([]byte, []int)
Deprecated: Use ScanOption.ProtoReflect.Descriptor instead.
func (*ScanOption) GetLevel ¶
func (x *ScanOption) GetLevel() ReadLevel
func (*ScanOption) GetLimits ¶
func (x *ScanOption) GetLimits() int32
func (*ScanOption) GetPrefix ¶
func (x *ScanOption) GetPrefix() string
func (*ScanOption) ProtoMessage ¶
func (*ScanOption) ProtoMessage()
func (*ScanOption) ProtoReflect ¶
func (x *ScanOption) ProtoReflect() protoreflect.Message
func (*ScanOption) Reset ¶
func (x *ScanOption) Reset()
func (*ScanOption) String ¶
func (x *ScanOption) String() string
type UnimplementedPeerServer ¶
type UnimplementedPeerServer struct { }
UnimplementedPeerServer must be embedded to have forward compatible implementations.
func (UnimplementedPeerServer) Join ¶
func (UnimplementedPeerServer) Join(context.Context, *PeerRequest) (*PeerReply, error)
func (UnimplementedPeerServer) Quit ¶
func (UnimplementedPeerServer) Quit(context.Context, *PeerRequest) (*PeerReply, error)
type UnimplementedSKVServer ¶
type UnimplementedSKVServer struct { }
UnimplementedSKVServer must be embedded to have forward compatible implementations.
func (UnimplementedSKVServer) Del ¶
func (UnimplementedSKVServer) Del(context.Context, *DelRequest) (*DelReply, error)
func (UnimplementedSKVServer) Get ¶
func (UnimplementedSKVServer) Get(context.Context, *GetRequest) (*GetReply, error)
func (UnimplementedSKVServer) GetMeta ¶
func (UnimplementedSKVServer) GetMeta(context.Context, *GetMetaRequest) (*GetMetaReply, error)
func (UnimplementedSKVServer) Put ¶
func (UnimplementedSKVServer) Put(context.Context, *KeyValuePair) (*PutReply, error)
func (UnimplementedSKVServer) Scan ¶
func (UnimplementedSKVServer) Scan(*ScanOption, SKV_ScanServer) error
type UnsafePeerServer ¶
type UnsafePeerServer interface {
// contains filtered or unexported methods
}
UnsafePeerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PeerServer will result in compilation errors.
type UnsafeSKVServer ¶
type UnsafeSKVServer interface {
// contains filtered or unexported methods
}
UnsafeSKVServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SKVServer will result in compilation errors.