adress

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 3 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 (
	TimezoneKey = "timezone"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

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

Address defines a location from Google’s place picker.

func New added in v0.0.15

func New(
	m Meta,
	c Comp,
	cr Core,
) *Address

type Comp

type Comp struct {
	Timezone *string `json:"timezone" validate:"nnpt"`
}

func ApplyComp

func ApplyComp(c *Comp, modifiers ...CompOption) Comp

func (*Comp) GetTimezone

func (a *Comp) GetTimezone() string

func (*Comp) SetTimezone

func (a *Comp) SetTimezone(x string)

type CompOption

type CompOption = contracti.CompOption[Comp]

func WithProcessedTimezone

func WithProcessedTimezone(ctx context.Context, latitude, longitude float64, client contract.Geocoder) (CompOption, error)

func WithTimezone

func WithTimezone(x string) CompOption

type Core

type Core struct {
	FormattedAddress *string  `json:"formatted_address" validate:"nnpt"`
	PlaceName        *string  `json:"place_name" validate:"nnpt"`
	Street           *string  `json:"street" validate:"nnpt"`
	City             *string  `json:"city" validate:"nnpt"`
	State            *string  `json:"state" validate:"nnpt"`
	PostalCode       *string  `json:"postal_code" validate:"nnpt"`
	Country          *string  `json:"country" 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