postcodenl

package
v0.1.1-0...-99c9eb7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2017 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPostcode    = errors.New("invalid postcode")
	ErrPostcodenlApiError = errors.New("postcode API error")
)

Functions

This section is empty.

Types

type API

type API interface {
	Check(postcode string, housenumber uint64) (*Data, error)
}

func New

func New(key, secret string) API

New creates a new API instance that wraps postcode.nl using provided key and secret

func NewMock

func NewMock() API

NewMock creates a new API instance that returns fake data

type Data

type Data struct {
	Street                 string   `json:"street"`
	HouseNumber            uint64   `json:"houseNumber"`
	HouseNumberAddition    string   `json:"houseNumberAddition"`
	Postcode               string   `json:"postcode"`
	City                   string   `json:"city"`
	Municipality           string   `json:"municipality"`
	Province               string   `json:"province"`
	RdX                    int      `json:"rdX"`
	RdY                    int      `json:"rdY"`
	Latitude               float64  `json:"latitude"`
	Longitude              float64  `json:"longitude"`
	BagNumberDesignationID string   `json:"bagNumberDesignationId"`
	BagAddressableObjectID string   `json:"bagAddressableObjectId"`
	AddressType            string   `json:"addressType"`
	Purposes               []string `json:"purposes"`
	SurfaceArea            int      `json:"surfaceArea"`
	HouseNumberAdditions   []string `json:"houseNumberAdditions"`
}

Data provided from postcode.nl API's

type Exception

type Exception struct {
	Exception   string `json:"exception"`
	ExceptionID string `json:"exceptionId"`
}

func (Exception) Error

func (e Exception) Error() string

Jump to

Keyboard shortcuts

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