Documentation ¶
Index ¶
- Variables
- func NewGrpcStorage(addresses []string, serverPort int, logLevel string) (kvstore.Storage, error)
- func RegisterKVStoreServer(s grpc.ServiceRegistrar, srv KVStoreServer)
- type KVStoreClient
- type KVStoreServer
- type StoreValRequest
- func (*StoreValRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StoreValRequest) GetKey() string
- func (x *StoreValRequest) GetStorage() string
- func (x *StoreValRequest) GetValue() string
- func (*StoreValRequest) ProtoMessage()
- func (x *StoreValRequest) ProtoReflect() protoreflect.Message
- func (x *StoreValRequest) Reset()
- func (x *StoreValRequest) String() string
- type StoreValResponse
- type UnimplementedKVStoreServer
- type UnsafeKVStoreServer
Constants ¶
This section is empty.
Variables ¶
var File_kvstore_kvstore_proto protoreflect.FileDescriptor
var KVStore_ServiceDesc = grpc.ServiceDesc{ ServiceName: "kvstore.KVStore", HandlerType: (*KVStoreServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "StoreVal", Handler: _KVStore_StoreVal_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "kvstore/kvstore.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 NewGrpcStorage ¶
NewGrpcStorage creates a new distributed kvstore.Storage.
func RegisterKVStoreServer ¶
func RegisterKVStoreServer(s grpc.ServiceRegistrar, srv KVStoreServer)
Types ¶
type KVStoreClient ¶
type KVStoreClient interface {
StoreVal(ctx context.Context, in *StoreValRequest, opts ...grpc.CallOption) (*StoreValResponse, 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 { StoreVal(context.Context, *StoreValRequest) (*StoreValResponse, error) // contains filtered or unexported methods }
KVStoreServer is the server API for KVStore service. All implementations must embed UnimplementedKVStoreServer for forward compatibility
type StoreValRequest ¶
type StoreValRequest struct { Storage string `protobuf:"bytes,1,opt,name=storage,proto3" json:"storage,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*StoreValRequest) Descriptor
deprecated
func (*StoreValRequest) Descriptor() ([]byte, []int)
Deprecated: Use StoreValRequest.ProtoReflect.Descriptor instead.
func (*StoreValRequest) GetKey ¶
func (x *StoreValRequest) GetKey() string
func (*StoreValRequest) GetStorage ¶
func (x *StoreValRequest) GetStorage() string
func (*StoreValRequest) GetValue ¶
func (x *StoreValRequest) GetValue() string
func (*StoreValRequest) ProtoMessage ¶
func (*StoreValRequest) ProtoMessage()
func (*StoreValRequest) ProtoReflect ¶
func (x *StoreValRequest) ProtoReflect() protoreflect.Message
func (*StoreValRequest) Reset ¶
func (x *StoreValRequest) Reset()
func (*StoreValRequest) String ¶
func (x *StoreValRequest) String() string
type StoreValResponse ¶
type StoreValResponse struct {
// contains filtered or unexported fields
}
func (*StoreValResponse) Descriptor
deprecated
func (*StoreValResponse) Descriptor() ([]byte, []int)
Deprecated: Use StoreValResponse.ProtoReflect.Descriptor instead.
func (*StoreValResponse) ProtoMessage ¶
func (*StoreValResponse) ProtoMessage()
func (*StoreValResponse) ProtoReflect ¶
func (x *StoreValResponse) ProtoReflect() protoreflect.Message
func (*StoreValResponse) Reset ¶
func (x *StoreValResponse) Reset()
func (*StoreValResponse) String ¶
func (x *StoreValResponse) String() string
type UnimplementedKVStoreServer ¶
type UnimplementedKVStoreServer struct { }
UnimplementedKVStoreServer must be embedded to have forward compatible implementations.
func (UnimplementedKVStoreServer) StoreVal ¶
func (UnimplementedKVStoreServer) StoreVal(context.Context, *StoreValRequest) (*StoreValResponse, 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.