proto

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterLdServer

func RegisterLdServer(s *grpc.Server, srv LdServer)

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) Descriptor() ([]byte, []int)

Deprecated: Use Key.ProtoReflect.Descriptor instead.

func (*Key) GetKey

func (x *Key) GetKey() string

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) ProtoReflect

func (x *Key) ProtoReflect() protoreflect.Message

func (*Key) Reset

func (x *Key) Reset()

func (*Key) String

func (x *Key) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use KeyRange.ProtoReflect.Descriptor instead.

func (*KeyRange) GetFrom

func (x *KeyRange) GetFrom() string

func (*KeyRange) GetPattern

func (x *KeyRange) GetPattern() string

func (*KeyRange) GetPrefix

func (x *KeyRange) GetPrefix() string

func (*KeyRange) GetTo

func (x *KeyRange) GetTo() string

func (*KeyRange) ProtoMessage

func (*KeyRange) ProtoMessage()

func (*KeyRange) ProtoReflect

func (x *KeyRange) ProtoReflect() protoreflect.Message

func (*KeyRange) Reset

func (x *KeyRange) Reset()

func (*KeyRange) String

func (x *KeyRange) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.

func (*KeyValue) GetKey

func (x *KeyValue) GetKey() string

func (*KeyValue) GetValue

func (x *KeyValue) GetValue() []byte

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) ProtoReflect

func (x *KeyValue) ProtoReflect() protoreflect.Message

func (*KeyValue) Reset

func (x *KeyValue) Reset()

func (*KeyValue) String

func (x *KeyValue) String() string

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_DeleteManyClient interface {
	Send(*Key) error
	Recv() (*KeyValue, error)
	grpc.ClientStream
}

type Ld_DeleteManyServer

type Ld_DeleteManyServer interface {
	Send(*KeyValue) error
	Recv() (*Key, error)
	grpc.ServerStream
}

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_GetManyClient interface {
	Send(*Key) error
	Recv() (*KeyValue, error)
	grpc.ClientStream
}

type Ld_GetManyServer

type Ld_GetManyServer interface {
	Send(*KeyValue) error
	Recv() (*Key, error)
	grpc.ServerStream
}

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_SetManyClient interface {
	Send(*KeyValue) error
	Recv() (*KeyValue, error)
	grpc.ClientStream
}

type Ld_SetManyServer

type Ld_SetManyServer interface {
	Send(*KeyValue) error
	Recv() (*KeyValue, error)
	grpc.ServerStream
}

type UnimplementedLdServer

type UnimplementedLdServer struct {
}

UnimplementedLdServer can be embedded to have forward compatible implementations.

func (*UnimplementedLdServer) Delete

func (*UnimplementedLdServer) DeleteMany

func (*UnimplementedLdServer) DeleteRange

func (*UnimplementedLdServer) Get

func (*UnimplementedLdServer) GetMany

func (*UnimplementedLdServer) GetRange

func (*UnimplementedLdServer) Set

func (*UnimplementedLdServer) SetMany

Jump to

Keyboard shortcuts

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