ld_proto

package
v0.0.0-...-bccaaa7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_my_message_proto protoreflect.FileDescriptor

Functions

func HandmadeTimeKeyString

func HandmadeTimeKeyString(timeIn string) string

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

func KeyFromMessage(feature *Feature) string

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

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

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

Deprecated: Use Feature.ProtoReflect.Descriptor instead.

func (*Feature) GetGeometry

func (x *Feature) GetGeometry() *Feature_Geometry

func (*Feature) GetId

func (x *Feature) GetId() string

func (*Feature) GetProperties

func (x *Feature) GetProperties() *Feature_Properties

func (*Feature) GetType

func (x *Feature) GetType() string

func (*Feature) ProtoMessage

func (*Feature) ProtoMessage()

func (*Feature) ProtoReflect

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

func (*Feature) Reset

func (x *Feature) Reset()

func (*Feature) String

func (x *Feature) String() string

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) 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
	//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) 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 *Feature `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() *Feature

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
	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_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