address

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StreetKey           = "street"
	CityKey             = "city"
	StateKey            = "state"
	PostalCodeKey       = "postal_code"
	CountryKey          = "country"
	LatitudeKey         = "latitude"
	LongitudeKey        = "longitude"
	PlaceIDKey          = "place_id"
	FormattedAddressKey = "formatted_address"
	PlaceNameKey        = "place_name"
)
View Source
const (
	AddressTimezoneKey = "address_timezone"
)

Variables

This section is empty.

Functions

func Idx

func Idx() []contract.IndexEntry

func IdxSrch

func IdxSrch() []contract.SearchIndexEntry

func Rules

Types

type Address

type Address struct {
	Meta `bson:",inline" validate:"recurse"`
	Comp `bson:",inline" validate:"recurse"`
	Core `bson:",inline" validate:"recurse"`
}

Address defines a location from Google’s place picker.

func Mock added in v0.0.42

func Mock() *Address

func New

func New(m Meta, cr Core) *Address

func (*Address) Compute

func (r *Address) Compute(ctx context.Context, opts engine.ComputeOptions) error

type Comp

type Comp struct {
	AddressTimezone *string `json:"address_timezone" validate:"nnpt,nz,tz"`
}

func (*Comp) GetAddressTimezone added in v0.0.73

func (c *Comp) GetAddressTimezone() string

func (*Comp) SetAddressTimezone added in v0.0.73

func (c *Comp) SetAddressTimezone(x string)

type Core

type Core struct {
	FormattedAddress *string  `json:"formatted_address" validate:"nnpt"`
	PlaceName        *string  `json:"place_name" validate:"nnpt"`
	Street           *string  `json:"street" conform:"trim,lower" validate:"nnpt"`
	City             *string  `json:"city" conform:"trim,lower" validate:"nnpt"`
	State            *string  `json:"state" conform:"trim,lower" validate:"nnpt"`
	PostalCode       *string  `json:"postal_code" conform:"trim,upper" validate:"nnpt"`
	Country          *string  `json:"country" conform:"trim,upper" validate:"nnpt"`
	Latitude         *float64 `json:"latitude" validate:"nnpt"`
	Longitude        *float64 `json:"longitude" validate:"nnpt"`
	PlaceID          *string  `json:"place_id" validate:"nnpt"`
}

func ApplyCore

func ApplyCore(c *Core, modifiers ...CoreOption) Core

func (*Core) GetCity

func (c *Core) GetCity() string

func (*Core) GetCountry

func (c *Core) GetCountry() string

func (*Core) GetFormattedAddress

func (c *Core) GetFormattedAddress() string

func (*Core) GetLatitude

func (c *Core) GetLatitude() float64

func (*Core) GetLongitude

func (c *Core) GetLongitude() float64

func (*Core) GetPlaceID

func (c *Core) GetPlaceID() string

func (*Core) GetPlaceName

func (c *Core) GetPlaceName() string

func (*Core) GetPostalCode

func (c *Core) GetPostalCode() string

func (*Core) GetState

func (c *Core) GetState() string

func (*Core) GetStreet

func (c *Core) GetStreet() string

func (*Core) SetCity

func (c *Core) SetCity(x string)

func (*Core) SetCountry

func (c *Core) SetCountry(x string)

func (*Core) SetFormattedAddress

func (c *Core) SetFormattedAddress(x string)

func (*Core) SetLatitude

func (c *Core) SetLatitude(x float64)

func (*Core) SetLongitude

func (c *Core) SetLongitude(x float64)

func (*Core) SetPlaceID

func (c *Core) SetPlaceID(x string)

func (*Core) SetPlaceName

func (c *Core) SetPlaceName(x string)

func (*Core) SetPostalCode

func (c *Core) SetPostalCode(x string)

func (*Core) SetState

func (c *Core) SetState(x string)

func (*Core) SetStreet

func (c *Core) SetStreet(x string)

type CoreOption

type CoreOption = contracti.CoreOption[Core]

func WithCity

func WithCity(x string) CoreOption

func WithCountry

func WithCountry(x string) CoreOption

func WithFormattedAddress

func WithFormattedAddress(x string) CoreOption

func WithLatitude

func WithLatitude(x float64) CoreOption

func WithLongitude

func WithLongitude(x float64) CoreOption

func WithPlaceID

func WithPlaceID(x string) CoreOption

func WithPlaceName

func WithPlaceName(x string) CoreOption

func WithPostalCode

func WithPostalCode(x string) CoreOption

func WithState

func WithState(x string) CoreOption

func WithStreet

func WithStreet(x string) CoreOption

type Meta

type Meta struct{}

func ApplyMeta

func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta

type MetaOption

type MetaOption = contract.MetaOption[Meta]

Jump to

Keyboard shortcuts

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