Help us shape the future of Go! Take the 2026 Go Developer Survey

geocoding

package
v1.3.214 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Found                    bool
	FromCache                bool
	AdministrativeAreaLevel1 string
	CityName                 string
	Address                  string
	Language                 string
	Location                 *LatLng
}

type Geocoding

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

func (*Geocoding) CutCoordinates added in v1.3.28

func (g *Geocoding) CutCoordinates(float float64, precision int) (float64, error)

func (*Geocoding) Geocode

func (g *Geocoding) Geocode(ctx context.Context, ormService *beeorm.Engine, address string, language string) (*Address, error)

func (*Geocoding) ReverseGeocode

func (g *Geocoding) ReverseGeocode(ctx context.Context, ormService *beeorm.Engine, latLng *LatLng, language string) (*Address, error)

func (*Geocoding) SnapToRoad added in v1.3.184

type GoogleMapsProvider

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

func (*GoogleMapsProvider) Geocode

func (g *GoogleMapsProvider) Geocode(ctx context.Context, address string, language string) (*Address, interface{}, error)

func (*GoogleMapsProvider) GetName

func (g *GoogleMapsProvider) GetName() string

func (*GoogleMapsProvider) ReverseGeocode

func (g *GoogleMapsProvider) ReverseGeocode(ctx context.Context, latLng *LatLng, language string) (*Address, interface{}, error)

func (*GoogleMapsProvider) SnapToRoad added in v1.3.184

type IGeocoding

type IGeocoding interface {
	SnapToRoad(ctx context.Context, dto *maps.SnapToRoadRequest) (*maps.SnapToRoadResponse, error)
	Geocode(ctx context.Context, ormService *beeorm.Engine, address string, language string) (*Address, error)
	ReverseGeocode(ctx context.Context, ormService *beeorm.Engine, latLng *LatLng, language string) (*Address, error)
	CutCoordinates(float float64, precision int) (float64, error)
}

func NewGeocoding

func NewGeocoding(
	useCaching bool,
	cacheTTLMinDays int,
	cacheTTLMaxDays int,
	clock clock.IClock,
	provider Provider,
) IGeocoding

type LatLng

type LatLng struct {
	Lat float64
	Lng float64
}

type Provider

type Provider interface {
	SnapToRoad(ctx context.Context, dto *maps.SnapToRoadRequest) (*maps.SnapToRoadResponse, error)
	Geocode(ctx context.Context, address string, language string) (*Address, interface{}, error)
	ReverseGeocode(ctx context.Context, latLng *LatLng, language string) (*Address, interface{}, error)
	GetName() string
}

func NewGoogleMapsProvider

func NewGoogleMapsProvider(apiKey string) Provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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