lib

package
v0.0.0-...-43c2a68 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CensusZipCoords = map[string]GeoCoordinates{}/* 33144 elements not displayed */

CensusZipCoords is a huge list of zip code to coordinate data from the Census Bureau.

Functions

func HarvesineDistance

func HarvesineDistance(coords1, coords2 GeoCoordinates) float64

HarvesineDistance finds the distance in KMs between two points on Earth. Formula converted to golang from https://www.movable-type.co.uk/scripts/latlong.html

Types

type GeoCoordinates

type GeoCoordinates struct {
	Lat  float64
	Long float64
}

GeoCoordinates represent a latitude and longitude on Earth.

func FindCoordsForPostcode

func FindCoordsForPostcode(zip string) (*GeoCoordinates, error)

FindCoordsForPostcode returns the geocoordinates for a zip code.

type HTTPGetter

type HTTPGetter interface {
	Get(url string) (resp *http.Response, err error)
}

HTTPGetter for mocking the HTTP client in tests.

type StringReadCloser

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

StringReadCloser implements ReadCloser and exposes a reader for strings.

func NewStringReadCloser

func NewStringReadCloser(s string) *StringReadCloser

NewStringReadCloser creates a new, initialized StringReadCloser.

func (*StringReadCloser) Close

func (src *StringReadCloser) Close() error

Close really does nothing except satify the ReadCloser interface.

func (*StringReadCloser) Read

func (src *StringReadCloser) Read(p []byte) (n int, err error)

Read reads data from the string.

Jump to

Keyboard shortcuts

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