Documentation ¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type FindFilter
- type Location
- type Locations
- type Point
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidHouseNumber = errors.New("Invalid house number")
)
var (
ErrInvalidPostCodeRange = errors.New("Invalid post code range")
)
var (
Stadfangaskra = Locations{}
)
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
Restore an asset under the given directory
func RestoreAssets ¶
Restore assets under the given directory recursively
Types ¶
type FindFilter ¶
change to bool, error is never used
func ByDistance ¶
func ByDistance(p Point, distance float64) (FindFilter, error)
ByDistance returns a FindFilter matching addresses within the given radius in km.
func ByLocationString ¶
func ByLocationString(s string) (FindFilter, error)
ByLocationString returns a FindFilter matching the criteria of the parsed input string.
func ByNumber ¶
func ByNumber(number string) (FindFilter, error)
ByNumber returns a FindFilter matching house numbers.
func ByPostCode ¶
func ByPostCode(code int) (FindFilter, error)
ByPostCode returns a FindFilter matching postcode.
func ByStreet ¶
func ByStreet(name string) (FindFilter, error)
ByStreet returns a FindFilter matching name of street.
type Location ¶
type Location struct { ID int `json:"id"` Name string `json:"name"` Number int `json:"house_number,omitempty"` NumberChars string `json:"house_characters,omitempty"` SpecificName string `json:"specific_name,omitempty"` Street string `json:"street,omitempty"` StreetDative string `json:"street_dative,omitempty"` Postcode int `json:"postcode"` Municipality string `json:"municipality,omitempty"` Coordinates Point `json:"coordinates"` JSONCache []byte `json:"-"` }