location

package
v0.0.0-...-976fe2d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceSensorProvider

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

DeviceSensorProvider is responsible for retrieving location data from a GPS device connected via serial port.

func NewDeviceSensorProvider

func NewDeviceSensorProvider(port string, baudRate int) *DeviceSensorProvider

NewDeviceSensorProvider creates a new instance of DeviceSensorProvider with the specified port and baud rate.

func (*DeviceSensorProvider) GetLocation

func (d *DeviceSensorProvider) GetLocation() (Location, error)

GetLocation reads GPS data from the device and returns the device's location.

type GoogleGeolocationProvider

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

GoogleGeolocationProvider uses the Google Maps API to get location data.

func NewGoogleGeolocationProvider

func NewGoogleGeolocationProvider(apiKey string) (*GoogleGeolocationProvider, error)

NewGoogleGeolocationProvider creates a new GoogleGeolocationProvider instance.

func (*GoogleGeolocationProvider) GetLocation

func (g *GoogleGeolocationProvider) GetLocation() (Location, error)

GetLocation retrieves the device's location using Google Maps Geolocation API.

type Location

type Location struct {
	Latitude  float64
	Longitude float64
	Accuracy  float64
}

Location represents the geographical coordinates of a device

type Provider

type Provider interface {
	GetLocation() (Location, error)
}

Provider interface defines the methods for location providers

Jump to

Keyboard shortcuts

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