Documentation ¶
Index ¶
- Variables
- func NewLocationEndpoints() []*api.Endpoint
- func RegisterLocationHandler(s server.Server, hdlr LocationHandler, opts ...server.HandlerOption) error
- type Entity
- type LocationHandler
- type LocationService
- type Point
- func (*Point) Descriptor() ([]byte, []int)deprecated
- func (x *Point) GetLatitude() float64
- func (x *Point) GetLongitude() float64
- func (x *Point) GetTimestamp() int64
- func (*Point) ProtoMessage()
- func (x *Point) ProtoReflect() protoreflect.Message
- func (x *Point) Reset()
- func (x *Point) String() string
- type ReadRequest
- type ReadResponse
- type SaveRequest
- type SaveResponse
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchRequest) GetCenter() *Point
- func (x *SearchRequest) GetNumEntities() int64
- func (x *SearchRequest) GetRadius() float64
- func (x *SearchRequest) GetType() string
- func (*SearchRequest) ProtoMessage()
- func (x *SearchRequest) ProtoReflect() protoreflect.Message
- func (x *SearchRequest) Reset()
- func (x *SearchRequest) String() string
- type SearchResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_location_proto protoreflect.FileDescriptor
Functions ¶
func NewLocationEndpoints ¶
func RegisterLocationHandler ¶
func RegisterLocationHandler(s server.Server, hdlr LocationHandler, opts ...server.HandlerOption) error
Types ¶
type Entity ¶
type Entity struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Location *Point `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"` // contains filtered or unexported fields }
func (*Entity) Descriptor
deprecated
func (*Entity) GetLocation ¶
func (*Entity) ProtoMessage ¶
func (*Entity) ProtoMessage()
func (*Entity) ProtoReflect ¶
func (x *Entity) ProtoReflect() protoreflect.Message
type LocationHandler ¶
type LocationHandler interface { // Read locations Read(context.Context, *ReadRequest, *ReadResponse) error // Save locations Save(context.Context, *SaveRequest, *SaveResponse) error Search(context.Context, *SearchRequest, *SearchResponse) error }
type LocationService ¶
type LocationService interface { // Read locations Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) // Save locations Save(ctx context.Context, in *SaveRequest, opts ...client.CallOption) (*SaveResponse, error) Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error) }
func NewLocationService ¶
func NewLocationService(name string, c client.Client) LocationService
type Point ¶
type Point struct { Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"` Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"` Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
A point is a GPS coordinate.
func (*Point) Descriptor
deprecated
func (*Point) GetLatitude ¶
func (*Point) GetLongitude ¶
func (*Point) GetTimestamp ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
func (*Point) ProtoReflect ¶
func (x *Point) ProtoReflect() protoreflect.Message
type ReadRequest ¶
type ReadRequest struct { // the entity id Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
Read an entity by its ID
func (*ReadRequest) Descriptor
deprecated
func (*ReadRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
func (*ReadRequest) GetId ¶
func (x *ReadRequest) GetId() string
func (*ReadRequest) ProtoMessage ¶
func (*ReadRequest) ProtoMessage()
func (*ReadRequest) ProtoReflect ¶
func (x *ReadRequest) ProtoReflect() protoreflect.Message
func (*ReadRequest) Reset ¶
func (x *ReadRequest) Reset()
func (*ReadRequest) String ¶
func (x *ReadRequest) String() string
type ReadResponse ¶
type ReadResponse struct { Entity *Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"` // contains filtered or unexported fields }
func (*ReadResponse) Descriptor
deprecated
func (*ReadResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.
func (*ReadResponse) GetEntity ¶
func (x *ReadResponse) GetEntity() *Entity
func (*ReadResponse) ProtoMessage ¶
func (*ReadResponse) ProtoMessage()
func (*ReadResponse) ProtoReflect ¶
func (x *ReadResponse) ProtoReflect() protoreflect.Message
func (*ReadResponse) Reset ¶
func (x *ReadResponse) Reset()
func (*ReadResponse) String ¶
func (x *ReadResponse) String() string
type SaveRequest ¶
type SaveRequest struct { Entity *Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"` // contains filtered or unexported fields }
Save an entity's current position
func (*SaveRequest) Descriptor
deprecated
func (*SaveRequest) Descriptor() ([]byte, []int)
Deprecated: Use SaveRequest.ProtoReflect.Descriptor instead.
func (*SaveRequest) GetEntity ¶
func (x *SaveRequest) GetEntity() *Entity
func (*SaveRequest) ProtoMessage ¶
func (*SaveRequest) ProtoMessage()
func (*SaveRequest) ProtoReflect ¶
func (x *SaveRequest) ProtoReflect() protoreflect.Message
func (*SaveRequest) Reset ¶
func (x *SaveRequest) Reset()
func (*SaveRequest) String ¶
func (x *SaveRequest) String() string
type SaveResponse ¶
type SaveResponse struct {
// contains filtered or unexported fields
}
func (*SaveResponse) Descriptor
deprecated
func (*SaveResponse) Descriptor() ([]byte, []int)
Deprecated: Use SaveResponse.ProtoReflect.Descriptor instead.
func (*SaveResponse) ProtoMessage ¶
func (*SaveResponse) ProtoMessage()
func (*SaveResponse) ProtoReflect ¶
func (x *SaveResponse) ProtoReflect() protoreflect.Message
func (*SaveResponse) Reset ¶
func (x *SaveResponse) Reset()
func (*SaveResponse) String ¶
func (x *SaveResponse) String() string
type SearchRequest ¶
type SearchRequest struct { // Central position to search from Center *Point `protobuf:"bytes,1,opt,name=center,proto3" json:"center,omitempty"` // radius in meters Radius float64 `protobuf:"fixed64,2,opt,name=radius,proto3" json:"radius,omitempty"` // type of entities to filter Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // number of entities to return NumEntities int64 `protobuf:"varint,4,opt,name=numEntities,proto3" json:"numEntities,omitempty"` // contains filtered or unexported fields }
Search for entities in a given radius
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetCenter ¶
func (x *SearchRequest) GetCenter() *Point
func (*SearchRequest) GetNumEntities ¶
func (x *SearchRequest) GetNumEntities() int64
func (*SearchRequest) GetRadius ¶
func (x *SearchRequest) GetRadius() float64
func (*SearchRequest) GetType ¶
func (x *SearchRequest) GetType() string
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type SearchResponse ¶
type SearchResponse struct { Entities []*Entity `protobuf:"bytes,1,rep,name=entities,proto3" json:"entities,omitempty"` // contains filtered or unexported fields }
func (*SearchResponse) Descriptor
deprecated
func (*SearchResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.
func (*SearchResponse) GetEntities ¶
func (x *SearchResponse) GetEntities() []*Entity
func (*SearchResponse) ProtoMessage ¶
func (*SearchResponse) ProtoMessage()
func (*SearchResponse) ProtoReflect ¶
func (x *SearchResponse) ProtoReflect() protoreflect.Message
func (*SearchResponse) Reset ¶
func (x *SearchResponse) Reset()
func (*SearchResponse) String ¶
func (x *SearchResponse) String() string
Click to show internal directories.
Click to hide internal directories.