googlemaps

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package googlemaps provides geocoding and timezone services using Google Maps APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client handles Google Maps API operations.

func NewClient

func NewClient(apiKey string, httpClient HTTPClient, logger *slog.Logger) *Client

NewClient creates a new Google Maps API client.

func (*Client) GeocodeLocation

func (c *Client) GeocodeLocation(ctx context.Context, location string) (*Location, error)

GeocodeLocation converts a location string to coordinates using Google Geocoding API.

func (*Client) TimezoneForCoordinates

func (c *Client) TimezoneForCoordinates(ctx context.Context, lat, lng float64) (string, error)

TimezoneForCoordinates gets the timezone for given coordinates using Google Timezone API.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient interface for making HTTP requests.

type Location

type Location struct {
	Latitude  float64
	Longitude float64
}

Location represents a geographic location with coordinates.

Jump to

Keyboard shortcuts

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