address

package
v0.0.0-...-a2a55bd Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADDRESS_VALIDATE_ENDPOINT string = "/meta/v1/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Country            string   `json:"country"`
	Name               string   `json:"name"`
	StreetAddress      []string `json:"street_address"`
	DependentLocality  string   `json:"dependent_locality"`
	Locality           string   `json:"locality"`
	AdministrativeArea string   `json:"administrative_area"`
	PostCode           string   `json:"post_code"`
	SortingCode        string   `json:"sorting_code"`
}

type Addressor

type Addressor interface {
	Validate(ctx context.Context, req *ValidateRequest) (interface{}, error)
}

func NewAddress

func NewAddress(url string, logger log.Logger) Addressor

type ValidateRequest

type ValidateRequest struct {
	common.Head

	Address *Address `json:"address"`
}

func NewValidateRequest

func NewValidateRequest(token string, address *Address) *ValidateRequest

type ValidateResponse

type ValidateResponse struct {
	Data interface{} `json:"data"`

	Status common.Status `json:"status"`
}

func (ValidateResponse) DoesError

func (vr ValidateResponse) DoesError() []string

Jump to

Keyboard shortcuts

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