geo

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientNotInitialized        = errors.New("client not initialized")
	ErrNoResultForCoordinates      = errors.New("no results found for the provided coordinates")
	ErrFailedToConnectToGoogleMaps = errors.New("failed to connect to google maps")
)

Functions

func NewGoogleMapsClient

func NewGoogleMapsClient(retryOpts helper.RetryOptions, opts MapsClientOptions) (*maps.Client, error)

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *defaultTool

Types

type Client

type Client interface {
	contract.Geocoder
}

func NewClient

func NewClient(c contract.GoogleMaps) (Client, error)

type MapsClientOptions

type MapsClientOptions struct {
	APIKey         string
	LimitPerSecond int
}

MapsClientOptions contains the options for the google maps client. A limit per second of 0 disable the rate limit.

func DefaultMapsClientOptions

func DefaultMapsClientOptions(APIKey string) MapsClientOptions

DefaultMapsClientOptions returns the default options for the google maps client.

Jump to

Keyboard shortcuts

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