Documentation ¶
Index ¶
- Variables
- func HandmadeTimeKeyString(timeIn string) string
- func KeyFromMessage(feature *Feature) string
- func RegisterLdServer(s *grpc.Server, srv LdServer)
- type Feature
- func (*Feature) Descriptor() ([]byte, []int)deprecated
- func (x *Feature) GetGeometry() *Feature_Geometry
- func (x *Feature) GetId() string
- func (x *Feature) GetProperties() *Feature_Properties
- func (x *Feature) GetType() string
- func (*Feature) ProtoMessage()
- func (x *Feature) ProtoReflect() protoreflect.Message
- func (x *Feature) Reset()
- func (x *Feature) String() string
- type Feature_Geometry
- func (*Feature_Geometry) Descriptor() ([]byte, []int)deprecated
- func (x *Feature_Geometry) GetCoordinates() []float64
- func (x *Feature_Geometry) GetType() string
- func (*Feature_Geometry) ProtoMessage()
- func (x *Feature_Geometry) ProtoReflect() protoreflect.Message
- func (x *Feature_Geometry) Reset()
- func (x *Feature_Geometry) String() string
- type Feature_Properties
- func (*Feature_Properties) Descriptor() ([]byte, []int)deprecated
- func (x *Feature_Properties) GetAmp() float32
- func (x *Feature_Properties) GetCreated() string
- func (x *Feature_Properties) GetObserved() string
- func (x *Feature_Properties) GetSensors() string
- func (x *Feature_Properties) GetStrokes() uint32
- func (x *Feature_Properties) GetType() uint32
- func (*Feature_Properties) ProtoMessage()
- func (x *Feature_Properties) ProtoReflect() protoreflect.Message
- func (x *Feature_Properties) Reset()
- func (x *Feature_Properties) String() string
- 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 ¶
var File_ld_proto protoreflect.FileDescriptor
var File_my_message_proto protoreflect.FileDescriptor
Functions ¶
func HandmadeTimeKeyString ¶
HandmadeTimeKeyString returns a 9 byte string that is breakable on year, day-of-year, hour and ten minutes. fx "2018-07-04T19:01:12.324000Z" >> 018185190
func KeyFromMessage ¶
KeyFromMessage given a Feature, returns a key representing the measurements time, geohash and some extra data This is "{YYY}{DDD}{HH}{10M}{GEOHASH8}{Type}{Amp}" the key is at least 19 characters long.
func RegisterLdServer ¶
Types ¶
type Feature ¶
type Feature struct { Geometry *Feature_Geometry `protobuf:"bytes,1,opt,name=geometry,proto3" json:"geometry,omitempty"` Properties *Feature_Properties `protobuf:"bytes,2,opt,name=properties,proto3" json:"properties,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Feature) Descriptor
deprecated
func (*Feature) GetGeometry ¶
func (x *Feature) GetGeometry() *Feature_Geometry
func (*Feature) GetProperties ¶
func (x *Feature) GetProperties() *Feature_Properties
func (*Feature) ProtoMessage ¶
func (*Feature) ProtoMessage()
func (*Feature) ProtoReflect ¶
func (x *Feature) ProtoReflect() protoreflect.Message
type Feature_Geometry ¶
type Feature_Geometry struct { Coordinates []float64 `protobuf:"fixed64,1,rep,packed,name=coordinates,proto3" json:"coordinates,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Feature_Geometry) Descriptor
deprecated
func (*Feature_Geometry) Descriptor() ([]byte, []int)
Deprecated: Use Feature_Geometry.ProtoReflect.Descriptor instead.
func (*Feature_Geometry) GetCoordinates ¶
func (x *Feature_Geometry) GetCoordinates() []float64
func (*Feature_Geometry) GetType ¶
func (x *Feature_Geometry) GetType() string
func (*Feature_Geometry) ProtoMessage ¶
func (*Feature_Geometry) ProtoMessage()
func (*Feature_Geometry) ProtoReflect ¶
func (x *Feature_Geometry) ProtoReflect() protoreflect.Message
func (*Feature_Geometry) Reset ¶
func (x *Feature_Geometry) Reset()
func (*Feature_Geometry) String ¶
func (x *Feature_Geometry) String() string
type Feature_Properties ¶
type Feature_Properties struct { Amp float32 `protobuf:"fixed32,1,opt,name=amp,proto3" json:"amp,omitempty"` Created string `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` Observed string `protobuf:"bytes,3,opt,name=observed,proto3" json:"observed,omitempty"` Sensors string `protobuf:"bytes,4,opt,name=sensors,proto3" json:"sensors,omitempty"` Strokes uint32 `protobuf:"varint,5,opt,name=strokes,proto3" json:"strokes,omitempty"` Type uint32 `protobuf:"varint,6,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Feature_Properties) Descriptor
deprecated
func (*Feature_Properties) Descriptor() ([]byte, []int)
Deprecated: Use Feature_Properties.ProtoReflect.Descriptor instead.
func (*Feature_Properties) GetAmp ¶
func (x *Feature_Properties) GetAmp() float32
func (*Feature_Properties) GetCreated ¶
func (x *Feature_Properties) GetCreated() string
func (*Feature_Properties) GetObserved ¶
func (x *Feature_Properties) GetObserved() string
func (*Feature_Properties) GetSensors ¶
func (x *Feature_Properties) GetSensors() string
func (*Feature_Properties) GetStrokes ¶
func (x *Feature_Properties) GetStrokes() uint32
func (*Feature_Properties) GetType ¶
func (x *Feature_Properties) GetType() uint32
func (*Feature_Properties) ProtoMessage ¶
func (*Feature_Properties) ProtoMessage()
func (*Feature_Properties) ProtoReflect ¶
func (x *Feature_Properties) ProtoReflect() protoreflect.Message
func (*Feature_Properties) Reset ¶
func (x *Feature_Properties) Reset()
func (*Feature_Properties) String ¶
func (x *Feature_Properties) String() string
type Key ¶
type Key struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
The Key when querying directly for it The Key in general could be any bytes, but pattern-scanning requires string, so I have decided to increase the requirements in order to add the convenience of pattern-searching.
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 //pattern-searching is the slowest operation. //pattern john* is the same as prefix: john, but slower Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` // RE2 style regex syntax via golang core: https://golang.org/pkg/regexp/ 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. // and +1 semantics on strings don't really work 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 *Feature `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 Set(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*KeyValue, error) SetMany(ctx context.Context, opts ...grpc.CallOption) (Ld_SetManyClient, error) //empty responses means no such key. 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) //returns the deleted object, empty means no such key 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 Set(context.Context, *KeyValue) (*KeyValue, error) SetMany(Ld_SetManyServer) error //empty responses means no such key. Get(context.Context, *Key) (*KeyValue, error) GetMany(Ld_GetManyServer) error GetRange(*KeyRange, Ld_GetRangeServer) error //returns the deleted object, empty means no such key 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