http

package
v0.0.0-rc8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultTimeout = time.Second * 10

Variables

View Source
var ErrTimeout = errors.New("timeout")

Functions

This section is empty.

Types

type EndpointBuilder

type EndpointBuilder interface {
	GeocodeURL(address string, cfg geocoding.GeocodeConfig) string
	ReverseGeocodeURL(loc geocoding.Location, cfg geocoding.ReverseGeocodeConfig) string
}

type Provider

type Provider struct {
	EndpointBuilder       EndpointBuilder
	ResponseParserFactory ResponseParserFactory
}

func (*Provider) Geocode

func (g *Provider) Geocode(address string, cfg geocoding.GeocodeConfig) ([]*geocoding.Location, error)

func (*Provider) GeocodeWithContext

func (g *Provider) GeocodeWithContext(
	ctx context.Context,
	address string,
	cfg geocoding.GeocodeConfig,
) ([]*geocoding.Location, error)

func (*Provider) ReverseGeocode

func (g *Provider) ReverseGeocode(
	loc geocoding.Location,
	cfg geocoding.ReverseGeocodeConfig,
) ([]*geocoding.Address, error)

func (*Provider) ReverseGeocodeWithContext

func (g *Provider) ReverseGeocodeWithContext(
	ctx context.Context,
	loc geocoding.Location,
	cfg geocoding.ReverseGeocodeConfig,
) ([]*geocoding.Address, error)

type ResponseParser

type ResponseParser interface {
	Locations() ([]*geocoding.Location, error)
	Addresses() ([]*geocoding.Address, error)
	Error() error
}

type ResponseParserFactory

type ResponseParserFactory func() ResponseParser

Jump to

Keyboard shortcuts

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