mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-12 02:45:11 +00:00
26 lines
453 B
Go
Executable File
26 lines
453 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/location"
|
|
)
|
|
|
|
// Save an entity's current position
|
|
func main() {
|
|
locationService := location.NewLocationService(os.Getenv("M3O_API_TOKEN"))
|
|
rsp, err := locationService.Save(&location.SaveRequest{
|
|
Entity: &location.Entity{
|
|
Id: "1",
|
|
Location: &location.Point{
|
|
Latitude: 51.511061,
|
|
Longitude: -0.120022,
|
|
Timestamp: 1622802761,
|
|
},
|
|
Type: "bike",
|
|
},
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|