Documentation ¶
Index ¶
- Variables
- func RegisterLdServer(s *grpc.Server, srv LdServer)
- type Key
- type KeyRange
- func (*KeyRange) Descriptor() ([]byte, []int)deprecated
- func (x *KeyRange) GetFrom() string
- func (x *KeyRange) GetPattern() string
- func (x *KeyRange) GetPrefix() string
- func (x *KeyRange) GetTo() string
- func (*KeyRange) ProtoMessage()
- func (x *KeyRange) ProtoReflect() protoreflect.Message
- func (x *KeyRange) Reset()
- func (x *KeyRange) String() string
- type KeyValue
- type LdClient
- type LdServer
- type Ld_DeleteManyClient
- type Ld_DeleteManyServer
- type Ld_DeleteRangeClient
- type Ld_DeleteRangeServer
- type Ld_GetManyClient
- type Ld_GetManyServer
- type Ld_GetRangeClient
- type Ld_GetRangeServer
- type Ld_SetManyClient
- type Ld_SetManyServer
- type UnimplementedLdServer
- func (*UnimplementedLdServer) Delete(context.Context, *Key) (*KeyValue, error)
- func (*UnimplementedLdServer) DeleteMany(Ld_DeleteManyServer) error
- func (*UnimplementedLdServer) DeleteRange(*KeyRange, Ld_DeleteRangeServer) error
- func (*UnimplementedLdServer) Get(context.Context, *Key) (*KeyValue, error)
- func (*UnimplementedLdServer) GetMany(Ld_GetManyServer) error
- func (*UnimplementedLdServer) GetRange(*KeyRange, Ld_GetRangeServer) error
- func (*UnimplementedLdServer) Set(context.Context, *KeyValue) (*KeyValue, error)
- func (*UnimplementedLdServer) SetMany(Ld_SetManyServer) error
Constants ¶
This section is empty.
Variables ¶
View Source
var File_ld_proto protoreflect.FileDescriptor
Functions ¶
func RegisterLdServer ¶
Types ¶
type Key ¶
type Key struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // [(validate.rules).string { pattern: "(?i)^[0-9a-zA-Z_-.~]+$", max_len: 64 }]; // https://tools.ietf.org/html/rfc3986//section-2.3 // contains filtered or unexported fields }
The Key when querying directly for it
func (*Key) Descriptor
deprecated
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) ProtoReflect ¶
func (x *Key) ProtoReflect() protoreflect.Message
type KeyRange ¶
type KeyRange struct { //A key-prefix to search within. //when using prefix along-side pattern and/or from-to they should both match. // ie. a prefix "jo" could be used to speed up query speed of // pattern "john*" or from: "john1" to: "john6" //the server will not try to guess a prefix from the pattern or from-to parameters Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` // RE2 style regex, see: https://github.com/google/re2/wiki/Syntax Pattern string `protobuf:"bytes,2,opt,name=pattern,proto3" json:"pattern,omitempty"` // both inclusive // required for discrete systems with discrete queries // -- since you cannot reference a value outside of the last/first, // and would then not be able to query the last/first record. From string `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"` To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` // contains filtered or unexported fields }
A key-range is the only possibility of querying the data outside of a direct Key. The logical operator between using prefix, pattern and from-to together is AND. OR is not implemented as it can be done using more than one request Empty KeyRange implies a full database stream
func (*KeyRange) Descriptor
deprecated
func (*KeyRange) GetPattern ¶
func (*KeyRange) ProtoMessage ¶
func (*KeyRange) ProtoMessage()
func (*KeyRange) ProtoReflect ¶
func (x *KeyRange) ProtoReflect() protoreflect.Message
type KeyValue ¶
type KeyValue struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //You can easily replace this with google's Any if your want to //Or replace with your own message-type // //fx you have some software that simply expose data from a datasource //Your software exposes it as proto. This will be your datasource. // rewrite this .proto-file on the client side // add `import "your_messages_file.proto"` // replace the bytes of this with the type/format you wish to save // this works because string, bytes and nested messages are encoded the same: // read https://developers.google.com/protocol-buffers/docs/encoding#strings // and https://developers.google.com/protocol-buffers/docs/encoding#embedded Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*KeyValue) Descriptor
deprecated
func (*KeyValue) ProtoMessage ¶
func (*KeyValue) ProtoMessage()
func (*KeyValue) ProtoReflect ¶
func (x *KeyValue) ProtoReflect() protoreflect.Message
type LdClient ¶
type LdClient interface { //empty response means success //the database returns your KeyValue for errors, order is not necessarily preserved Set(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*KeyValue, error) SetMany(ctx context.Context, opts ...grpc.CallOption) (Ld_SetManyClient, error) Get(ctx context.Context, in *Key, opts ...grpc.CallOption) (*KeyValue, error) GetMany(ctx context.Context, opts ...grpc.CallOption) (Ld_GetManyClient, error) GetRange(ctx context.Context, in *KeyRange, opts ...grpc.CallOption) (Ld_GetRangeClient, error) Delete(ctx context.Context, in *Key, opts ...grpc.CallOption) (*KeyValue, error) DeleteMany(ctx context.Context, opts ...grpc.CallOption) (Ld_DeleteManyClient, error) DeleteRange(ctx context.Context, in *KeyRange, opts ...grpc.CallOption) (Ld_DeleteRangeClient, error) }
LdClient is the client API for Ld service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewLdClient ¶
func NewLdClient(cc grpc.ClientConnInterface) LdClient
type LdServer ¶
type LdServer interface { //empty response means success //the database returns your KeyValue for errors, order is not necessarily preserved Set(context.Context, *KeyValue) (*KeyValue, error) SetMany(Ld_SetManyServer) error Get(context.Context, *Key) (*KeyValue, error) GetMany(Ld_GetManyServer) error GetRange(*KeyRange, Ld_GetRangeServer) error Delete(context.Context, *Key) (*KeyValue, error) DeleteMany(Ld_DeleteManyServer) error DeleteRange(*KeyRange, Ld_DeleteRangeServer) error }
LdServer is the server API for Ld service.
type Ld_DeleteManyClient ¶
type Ld_DeleteManyServer ¶
type Ld_DeleteRangeClient ¶
type Ld_DeleteRangeClient interface { Recv() (*KeyValue, error) grpc.ClientStream }
type Ld_DeleteRangeServer ¶
type Ld_DeleteRangeServer interface { Send(*KeyValue) error grpc.ServerStream }
type Ld_GetManyClient ¶
type Ld_GetManyServer ¶
type Ld_GetRangeClient ¶
type Ld_GetRangeClient interface { Recv() (*KeyValue, error) grpc.ClientStream }
type Ld_GetRangeServer ¶
type Ld_GetRangeServer interface { Send(*KeyValue) error grpc.ServerStream }
type Ld_SetManyClient ¶
type Ld_SetManyServer ¶
type UnimplementedLdServer ¶
type UnimplementedLdServer struct { }
UnimplementedLdServer can be embedded to have forward compatible implementations.
func (*UnimplementedLdServer) DeleteMany ¶
func (*UnimplementedLdServer) DeleteMany(Ld_DeleteManyServer) error
func (*UnimplementedLdServer) DeleteRange ¶
func (*UnimplementedLdServer) DeleteRange(*KeyRange, Ld_DeleteRangeServer) error
func (*UnimplementedLdServer) GetMany ¶
func (*UnimplementedLdServer) GetMany(Ld_GetManyServer) error
func (*UnimplementedLdServer) GetRange ¶
func (*UnimplementedLdServer) GetRange(*KeyRange, Ld_GetRangeServer) error
func (*UnimplementedLdServer) SetMany ¶
func (*UnimplementedLdServer) SetMany(Ld_SetManyServer) error
Click to show internal directories.
Click to hide internal directories.