Documentation
¶
Index ¶
- Constants
- Variables
- func Idx(p ...string) []contract.IndexEntry
- func IdxSrch(p ...string) []contract.SearchIndexEntry
- func Rules(p ...string) contractpkg.QueryParamRules
- type Address
- type Comp
- type Core
- func (c *Core) GetCity() string
- func (c *Core) GetCountry() string
- func (c *Core) GetFormattedAddress() string
- func (c *Core) GetPlaceID() string
- func (c *Core) GetPlaceName() string
- func (c *Core) GetPostalCode() string
- func (c *Core) GetState() string
- func (c *Core) GetStreet() string
- func (c *Core) SetCity(x string)
- func (c *Core) SetCountry(x string)
- func (c *Core) SetFormattedAddress(x string)
- func (c *Core) SetPlaceID(x string)
- func (c *Core) SetPlaceName(x string)
- func (c *Core) SetPostalCode(x string)
- func (c *Core) SetState(x string)
- func (c *Core) SetStreet(x string)
- type CoreOption
- func WithCity(x string) CoreOption
- func WithCountry(x string) CoreOption
- func WithFormattedAddress(x string) CoreOption
- func WithLatLon(x latlon.LatLon) CoreOption
- func WithPlaceID(x string) CoreOption
- func WithPlaceName(x string) CoreOption
- func WithPostalCode(x string) CoreOption
- func WithState(x string) CoreOption
- func WithStreet(x string) CoreOption
- type Meta
- type MetaOption
Constants ¶
View Source
const ( StreetKey = "street" CityKey = "city" StateKey = "state" PostalCodeKey = "postal_code" CountryKey = "country" PlaceIDKey = "place_id" FormattedAddressKey = "formatted_address" PlaceNameKey = "place_name" )
View Source
const (
AddressTimezoneKey = "address_timezone"
)
Variables ¶
View Source
var ( StreetKeyFn = contract.PathKeyFn(StreetKey) CityKeyFn = contract.PathKeyFn(CityKey) StateKeyFn = contract.PathKeyFn(StateKey) PostalCodeKeyFn = contract.PathKeyFn(PostalCodeKey) CountryKeyFn = contract.PathKeyFn(CountryKey) PlaceIDKeyFn = contract.PathKeyFn(PlaceIDKey) FormattedAddressKeyFn = contract.PathKeyFn(FormattedAddressKey) PlaceNameKeyFn = contract.PathKeyFn(PlaceNameKey) )
View Source
var AddressTimezoneKeyFn = contract.PathKeyFn(AddressTimezoneKey)
Functions ¶
func Idx ¶
func Idx(p ...string) []contract.IndexEntry
func IdxSrch ¶
func IdxSrch(p ...string) []contract.SearchIndexEntry
func Rules ¶
func Rules(p ...string) contractpkg.QueryParamRules
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.
type Comp ¶
type Comp struct {
AddressTimezone *string `json:"address_timezone" validate:"nnpt,nz,tz"`
}
func (*Comp) GetAddressTimezone ¶ added in v0.0.73
func (*Comp) SetAddressTimezone ¶ added in v0.0.73
type Core ¶
type Core struct {
latlon.LatLon `bson:",inline" validate:"recurse"`
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"`
PlaceID *string `json:"place_id" validate:"nnpt"`
}
func ApplyCore ¶
func ApplyCore(c *Core, modifiers ...CoreOption) Core
func (*Core) GetCountry ¶
func (*Core) GetFormattedAddress ¶
func (*Core) GetPlaceID ¶
func (*Core) GetPlaceName ¶
func (*Core) GetPostalCode ¶
func (*Core) SetCountry ¶
func (*Core) SetFormattedAddress ¶
func (*Core) SetPlaceID ¶
func (*Core) SetPlaceName ¶
func (*Core) SetPostalCode ¶
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 WithLatLon ¶ added in v0.0.181
func WithLatLon(x latlon.LatLon) 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]
Click to show internal directories.
Click to hide internal directories.