location

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_location_proto protoreflect.FileDescriptor

Functions

func NewLocationEndpoints

func NewLocationEndpoints() []*api.Endpoint

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

Deprecated: Use Entity.ProtoReflect.Descriptor instead.

func (*Entity) GetId

func (x *Entity) GetId() string

func (*Entity) GetLocation

func (x *Entity) GetLocation() *Point

func (*Entity) GetType

func (x *Entity) GetType() string

func (*Entity) ProtoMessage

func (*Entity) ProtoMessage()

func (*Entity) ProtoReflect

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

func (*Entity) Reset

func (x *Entity) Reset()

func (*Entity) String

func (x *Entity) String() string

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

Deprecated: Use Point.ProtoReflect.Descriptor instead.

func (*Point) GetLatitude

func (x *Point) GetLatitude() float64

func (*Point) GetLongitude

func (x *Point) GetLongitude() float64

func (*Point) GetTimestamp

func (x *Point) GetTimestamp() int64

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) ProtoReflect

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

func (*Point) Reset

func (x *Point) Reset()

func (*Point) String

func (x *Point) String() string

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"`
	// Maximum number of entities to return
	Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,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) GetLimit

func (x *SearchRequest) GetLimit() 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

Jump to

Keyboard shortcuts

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