Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterKvstoreServer(s grpc.ServiceRegistrar, srv KvstoreServer)
- func Start(unixPath string, db *bbolt.Cache) (io.Closer, error)
- type Element
- func (x *Element) ClearKey()
- func (x *Element) ClearValue()
- func (x *Element) GetBuckets() []string
- func (x *Element) GetKey() []byte
- func (x *Element) GetValue() []byte
- func (x *Element) HasKey() bool
- func (x *Element) HasValue() bool
- func (*Element) ProtoMessage()
- func (x *Element) ProtoReflect() protoreflect.Message
- func (x *Element) Reset()
- func (x *Element) SetBuckets(v []string)
- func (x *Element) SetKey(v []byte)
- func (x *Element) SetValue(v []byte)
- func (x *Element) String() string
- type Element_builder
- type KV
- func (k *KV) Delete(ctx context.Context, req *Keys) (*emptypb.Empty, error)
- func (k *KV) Get(ctx context.Context, e *Element) (*Element, error)
- func (k *KV) Ping(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (k *KV) Range(req *Element, s grpc.ServerStreamingServer[Element]) error
- func (k *KV) Set(ctx context.Context, e *Element) (*emptypb.Empty, error)
- type KVStoreCli
- func (c *KVStoreCli) Close() error
- func (c *KVStoreCli) Delete(k ...[]byte) error
- func (c *KVStoreCli) Get(k []byte) ([]byte, error)
- func (c *KVStoreCli) NewCache(b string) cache.RecursionCache
- func (c *KVStoreCli) Put(k []byte, v []byte) error
- func (c *KVStoreCli) Range(f func(key []byte, value []byte) bool) error
- type Keys
- type Keys_builder
- type KvstoreClient
- type KvstoreServer
- type Kvstore_RangeClient
- type Kvstore_RangeServer
- type UnimplementedKvstoreServer
- func (UnimplementedKvstoreServer) Delete(context.Context, *Keys) (*emptypb.Empty, error)
- func (UnimplementedKvstoreServer) Get(context.Context, *Element) (*Element, error)
- func (UnimplementedKvstoreServer) Ping(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (UnimplementedKvstoreServer) Range(*Element, grpc.ServerStreamingServer[Element]) error
- func (UnimplementedKvstoreServer) Set(context.Context, *Element) (*emptypb.Empty, error)
- type UnsafeKvstoreServer
Constants ¶
const ( Kvstore_Get_FullMethodName = "/yuhaiin.kvstore.kvstore/Get" Kvstore_Set_FullMethodName = "/yuhaiin.kvstore.kvstore/Set" Kvstore_Delete_FullMethodName = "/yuhaiin.kvstore.kvstore/Delete" Kvstore_Range_FullMethodName = "/yuhaiin.kvstore.kvstore/Range" Kvstore_Ping_FullMethodName = "/yuhaiin.kvstore.kvstore/Ping" )
Variables ¶
var File_kv_kv_proto protoreflect.FileDescriptor
var Kvstore_ServiceDesc = grpc.ServiceDesc{ ServiceName: "yuhaiin.kvstore.kvstore", HandlerType: (*KvstoreServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _Kvstore_Get_Handler, }, { MethodName: "Set", Handler: _Kvstore_Set_Handler, }, { MethodName: "Delete", Handler: _Kvstore_Delete_Handler, }, { MethodName: "Ping", Handler: _Kvstore_Ping_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Range", Handler: _Kvstore_Range_Handler, ServerStreams: true, }, }, Metadata: "kv/kv.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 RegisterKvstoreServer ¶
func RegisterKvstoreServer(s grpc.ServiceRegistrar, srv KvstoreServer)
Types ¶
type Element ¶
type Element struct {
XXX_raceDetectHookData protoimpl.RaceDetectHookData
XXX_presence [1]uint32
// contains filtered or unexported fields
}
func (*Element) ClearValue ¶
func (x *Element) ClearValue()
func (*Element) GetBuckets ¶
func (*Element) ProtoMessage ¶
func (*Element) ProtoMessage()
func (*Element) ProtoReflect ¶
func (x *Element) ProtoReflect() protoreflect.Message
func (*Element) SetBuckets ¶
type Element_builder ¶
type Element_builder struct {
Buckets []string
Key []byte
Value []byte
// contains filtered or unexported fields
}
func (Element_builder) Build ¶
func (b0 Element_builder) Build() *Element
type KV ¶
type KV struct {
UnimplementedKvstoreServer
// contains filtered or unexported fields
}
type KVStoreCli ¶
type KVStoreCli struct {
KvstoreClient
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(unixPath string) (*KVStoreCli, error)
func (*KVStoreCli) Close ¶
func (c *KVStoreCli) Close() error
func (*KVStoreCli) Delete ¶
func (c *KVStoreCli) Delete(k ...[]byte) error
func (*KVStoreCli) NewCache ¶
func (c *KVStoreCli) NewCache(b string) cache.RecursionCache
type Keys ¶
type Keys struct {
// contains filtered or unexported fields
}
func (*Keys) GetBuckets ¶
func (*Keys) ProtoMessage ¶
func (*Keys) ProtoMessage()
func (*Keys) ProtoReflect ¶
func (x *Keys) ProtoReflect() protoreflect.Message
func (*Keys) SetBuckets ¶
type Keys_builder ¶
type Keys_builder struct {
Buckets []string
Keys [][]byte
// contains filtered or unexported fields
}
func (Keys_builder) Build ¶
func (b0 Keys_builder) Build() *Keys
type KvstoreClient ¶
type KvstoreClient interface {
Get(ctx context.Context, in *Element, opts ...grpc.CallOption) (*Element, error)
Set(ctx context.Context, in *Element, opts ...grpc.CallOption) (*emptypb.Empty, error)
Delete(ctx context.Context, in *Keys, opts ...grpc.CallOption) (*emptypb.Empty, error)
Range(ctx context.Context, in *Element, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Element], error)
Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, 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 {
Get(context.Context, *Element) (*Element, error)
Set(context.Context, *Element) (*emptypb.Empty, error)
Delete(context.Context, *Keys) (*emptypb.Empty, error)
Range(*Element, grpc.ServerStreamingServer[Element]) error
Ping(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
// contains filtered or unexported methods
}
KvstoreServer is the server API for Kvstore service. All implementations must embed UnimplementedKvstoreServer for forward compatibility.
type Kvstore_RangeClient ¶
type Kvstore_RangeClient = grpc.ServerStreamingClient[Element]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Kvstore_RangeServer ¶
type Kvstore_RangeServer = grpc.ServerStreamingServer[Element]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type UnimplementedKvstoreServer ¶
type UnimplementedKvstoreServer struct{}
UnimplementedKvstoreServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedKvstoreServer) Range ¶
func (UnimplementedKvstoreServer) Range(*Element, grpc.ServerStreamingServer[Element]) 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.