gloc

package
v0.0.0-...-85f71f1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2018 License: GPL-3.0 Imports: 13 Imported by: 0

README

This is basically a port of this python library: https://github.com/costastf/locationsharinglib

Usage

Start by creating a dedicated Google account and sharing one or more device locations with it through the "Location Sharing" feature of Google Maps. Using credentials to access that account, this library will retrieve the name, latitude and longitude of each person whose location is shared.

It cannot retrieve the location of the account it logs in as.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Demo

func Demo(username, password string) error

Types

type Location

type Location struct {
	Name      string
	Latitude  float64
	Longitude float64
}

func (Location) Distance

func (l Location) Distance(other Location) float64

Distance returns the great circle distance between two points in kilometers using the Haversine formula.

func (Location) String

func (l Location) String() string

type LocationClient

type LocationClient struct {
	Username string
	// contains filtered or unexported fields
}

func NewLocationClient

func NewLocationClient(username, password string) (*LocationClient, error)

func (*LocationClient) Get

func (c *LocationClient) Get() ([]Location, error)

Jump to

Keyboard shortcuts

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