geocoding

package
v1.2.72 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LanguageEnglish   = Language("en")
	LanguageBulgarian = Language("bg")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

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

type Geocoding

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

func (*Geocoding) Geocode

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

func (*Geocoding) ReverseGeocode

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

type GoogleMapsProvider

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

func (*GoogleMapsProvider) Geocode

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

func (*GoogleMapsProvider) GetName

func (g *GoogleMapsProvider) GetName() string

func (*GoogleMapsProvider) ReverseGeocode

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

type IGeocoding

type IGeocoding interface {
	Geocode(ctx context.Context, ormService *beeorm.Engine, address string, language Language) (*Address, error)
	ReverseGeocode(ctx context.Context, ormService *beeorm.Engine, latLng *LatLng, language Language) (*Address, error)
}

func NewGeocoding

func NewGeocoding(useCaching bool, cacheExpiryDays int64, clock clock.IClock, provider Provider) IGeocoding

type Language

type Language string

type LatLng

type LatLng struct {
	Lat float64
	Lng float64
}

type Provider

type Provider interface {
	Geocode(ctx context.Context, address string, language Language) (*Address, interface{}, error)
	ReverseGeocode(ctx context.Context, latLng *LatLng, language Language) (*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