postcode

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_postcode_proto protoreflect.FileDescriptor

Functions

func NewPostcodeEndpoints

func NewPostcodeEndpoints() []*api.Endpoint

func RegisterPostcodeHandler

func RegisterPostcodeHandler(s server.Server, hdlr PostcodeHandler, opts ...server.HandlerOption) error

Types

type LookupRequest

type LookupRequest struct {

	// UK postcode e.g SW1A 2AA
	Postcode string `protobuf:"bytes,1,opt,name=postcode,proto3" json:"postcode,omitempty"`
	// contains filtered or unexported fields
}

Lookup a postcode to retrieve the related region, county, etc

func (*LookupRequest) Descriptor deprecated

func (*LookupRequest) Descriptor() ([]byte, []int)

Deprecated: Use LookupRequest.ProtoReflect.Descriptor instead.

func (*LookupRequest) GetPostcode

func (x *LookupRequest) GetPostcode() string

func (*LookupRequest) ProtoMessage

func (*LookupRequest) ProtoMessage()

func (*LookupRequest) ProtoReflect

func (x *LookupRequest) ProtoReflect() protoreflect.Message

func (*LookupRequest) Reset

func (x *LookupRequest) Reset()

func (*LookupRequest) String

func (x *LookupRequest) String() string

type LookupResponse

type LookupResponse struct {

	// UK postcode e.g SW1A 2AA
	Postcode string `protobuf:"bytes,1,opt,name=postcode,proto3" json:"postcode,omitempty"`
	// country e.g United Kingdom
	Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"`
	// related region e.g London
	Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"`
	// e.g Westminster
	District string `protobuf:"bytes,4,opt,name=district,proto3" json:"district,omitempty"`
	// e.g St James's
	Ward string `protobuf:"bytes,5,opt,name=ward,proto3" json:"ward,omitempty"`
	// e.g 51.50354
	Latitude float64 `protobuf:"fixed64,6,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// e.g -0.127695
	Longitude float64 `protobuf:"fixed64,7,opt,name=longitude,proto3" json:"longitude,omitempty"`
	// contains filtered or unexported fields
}

func (*LookupResponse) Descriptor deprecated

func (*LookupResponse) Descriptor() ([]byte, []int)

Deprecated: Use LookupResponse.ProtoReflect.Descriptor instead.

func (*LookupResponse) GetCountry

func (x *LookupResponse) GetCountry() string

func (*LookupResponse) GetDistrict

func (x *LookupResponse) GetDistrict() string

func (*LookupResponse) GetLatitude

func (x *LookupResponse) GetLatitude() float64

func (*LookupResponse) GetLongitude

func (x *LookupResponse) GetLongitude() float64

func (*LookupResponse) GetPostcode

func (x *LookupResponse) GetPostcode() string

func (*LookupResponse) GetRegion

func (x *LookupResponse) GetRegion() string

func (*LookupResponse) GetWard

func (x *LookupResponse) GetWard() string

func (*LookupResponse) ProtoMessage

func (*LookupResponse) ProtoMessage()

func (*LookupResponse) ProtoReflect

func (x *LookupResponse) ProtoReflect() protoreflect.Message

func (*LookupResponse) Reset

func (x *LookupResponse) Reset()

func (*LookupResponse) String

func (x *LookupResponse) String() string

type PostcodeService

type PostcodeService interface {
	Lookup(ctx context.Context, in *LookupRequest, opts ...client.CallOption) (*LookupResponse, error)
	Random(ctx context.Context, in *RandomRequest, opts ...client.CallOption) (*RandomResponse, error)
	Validate(ctx context.Context, in *ValidateRequest, opts ...client.CallOption) (*ValidateResponse, error)
}

func NewPostcodeService

func NewPostcodeService(name string, c client.Client) PostcodeService

type RandomRequest

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

Return a random postcode and its related info

func (*RandomRequest) Descriptor deprecated

func (*RandomRequest) Descriptor() ([]byte, []int)

Deprecated: Use RandomRequest.ProtoReflect.Descriptor instead.

func (*RandomRequest) ProtoMessage

func (*RandomRequest) ProtoMessage()

func (*RandomRequest) ProtoReflect

func (x *RandomRequest) ProtoReflect() protoreflect.Message

func (*RandomRequest) Reset

func (x *RandomRequest) Reset()

func (*RandomRequest) String

func (x *RandomRequest) String() string

type RandomResponse

type RandomResponse struct {

	// UK postcode e.g SW1A 2AA
	Postcode string `protobuf:"bytes,1,opt,name=postcode,proto3" json:"postcode,omitempty"`
	// country e.g United Kingdom
	Country string `protobuf:"bytes,2,opt,name=country,proto3" json:"country,omitempty"`
	// related region e.g London
	Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"`
	// e.g Westminster
	District string `protobuf:"bytes,4,opt,name=district,proto3" json:"district,omitempty"`
	// e.g St James's
	Ward string `protobuf:"bytes,5,opt,name=ward,proto3" json:"ward,omitempty"`
	// e.g 51.50354
	Latitude float64 `protobuf:"fixed64,6,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// e.g -0.127695
	Longitude float64 `protobuf:"fixed64,7,opt,name=longitude,proto3" json:"longitude,omitempty"`
	// contains filtered or unexported fields
}

func (*RandomResponse) Descriptor deprecated

func (*RandomResponse) Descriptor() ([]byte, []int)

Deprecated: Use RandomResponse.ProtoReflect.Descriptor instead.

func (*RandomResponse) GetCountry

func (x *RandomResponse) GetCountry() string

func (*RandomResponse) GetDistrict

func (x *RandomResponse) GetDistrict() string

func (*RandomResponse) GetLatitude

func (x *RandomResponse) GetLatitude() float64

func (*RandomResponse) GetLongitude

func (x *RandomResponse) GetLongitude() float64

func (*RandomResponse) GetPostcode

func (x *RandomResponse) GetPostcode() string

func (*RandomResponse) GetRegion

func (x *RandomResponse) GetRegion() string

func (*RandomResponse) GetWard

func (x *RandomResponse) GetWard() string

func (*RandomResponse) ProtoMessage

func (*RandomResponse) ProtoMessage()

func (*RandomResponse) ProtoReflect

func (x *RandomResponse) ProtoReflect() protoreflect.Message

func (*RandomResponse) Reset

func (x *RandomResponse) Reset()

func (*RandomResponse) String

func (x *RandomResponse) String() string

type ValidateRequest

type ValidateRequest struct {

	// UK postcode e.g SW1A 2AA
	Postcode string `protobuf:"bytes,1,opt,name=postcode,proto3" json:"postcode,omitempty"`
	// contains filtered or unexported fields
}

Validate a postcode. Should return valid: true or valid: false

func (*ValidateRequest) Descriptor deprecated

func (*ValidateRequest) Descriptor() ([]byte, []int)

Deprecated: Use ValidateRequest.ProtoReflect.Descriptor instead.

func (*ValidateRequest) GetPostcode

func (x *ValidateRequest) GetPostcode() string

func (*ValidateRequest) ProtoMessage

func (*ValidateRequest) ProtoMessage()

func (*ValidateRequest) ProtoReflect

func (x *ValidateRequest) ProtoReflect() protoreflect.Message

func (*ValidateRequest) Reset

func (x *ValidateRequest) Reset()

func (*ValidateRequest) String

func (x *ValidateRequest) String() string

type ValidateResponse

type ValidateResponse struct {
	Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
	// contains filtered or unexported fields
}

func (*ValidateResponse) Descriptor deprecated

func (*ValidateResponse) Descriptor() ([]byte, []int)

Deprecated: Use ValidateResponse.ProtoReflect.Descriptor instead.

func (*ValidateResponse) GetValid

func (x *ValidateResponse) GetValid() bool

func (*ValidateResponse) ProtoMessage

func (*ValidateResponse) ProtoMessage()

func (*ValidateResponse) ProtoReflect

func (x *ValidateResponse) ProtoReflect() protoreflect.Message

func (*ValidateResponse) Reset

func (x *ValidateResponse) Reset()

func (*ValidateResponse) String

func (x *ValidateResponse) String() string

Jump to

Keyboard shortcuts

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