location

package
v0.0.0-...-795d1ad Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	Id       string `json:"id"`
	Location *Point `json:"location"`
	Type     string `json:"type"`
}

type LocationService

type LocationService struct {
	// contains filtered or unexported fields
}

func NewLocationService

func NewLocationService(token string) *LocationService

func (*LocationService) Read

func (t *LocationService) Read(request *ReadRequest) (*ReadResponse, error)

Read an entity by its ID

func (*LocationService) Save

func (t *LocationService) Save(request *SaveRequest) (*SaveResponse, error)

Save an entity's current position

func (*LocationService) Search

func (t *LocationService) Search(request *SearchRequest) (*SearchResponse, error)

Search for entities in a given radius

type Point

type Point struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Timestamp int64   `json:"timestamp"`
}

type ReadRequest

type ReadRequest struct {
	// the entity id
	Id string `json:"id"`
}

type ReadResponse

type ReadResponse struct {
	Entity *Entity `json:"entity"`
}

type SaveRequest

type SaveRequest struct {
	Entity *Entity `json:"entity"`
}

type SaveResponse

type SaveResponse struct {
}

type SearchRequest

type SearchRequest struct {
	// Central position to search from
	Center *Point `json:"center"`
	// Maximum number of entities to return
	NumEntities int64 `json:"numEntities"`
	// radius in meters
	Radius float64 `json:"radius"`
	// type of entities to filter
	Type string `json:"type"`
}

type SearchResponse

type SearchResponse struct {
	Entities []Entity `json:"entities"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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