kvstore

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_kvstore_kvstore_proto protoreflect.FileDescriptor
View Source
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

func NewGrpcStorage(addresses []string, serverPort int, logLevel string) (kvstore.Storage, error)

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL