Documentation
¶
Index ¶
- Constants
- type Address
- func (a *Address) GetCity() string
- func (a *Address) GetCountry() string
- func (a *Address) GetFormattedAddress() string
- func (a *Address) GetLatitude() float64
- func (a *Address) GetLongitude() float64
- func (a *Address) GetPlaceID() string
- func (a *Address) GetPlaceName() string
- func (a *Address) GetPostalCode() string
- func (a *Address) GetState() string
- func (a *Address) GetStreet() string
- func (a *Address) SetCity(x string)
- func (a *Address) SetCountry(x string)
- func (a *Address) SetFormattedAddress(x string)
- func (a *Address) SetLatitude(x float64)
- func (a *Address) SetLongitude(x float64)
- func (a *Address) SetPlaceID(x string)
- func (a *Address) SetPlaceName(x string)
- func (a *Address) SetPostalCode(x string)
- func (a *Address) SetState(x string)
- func (a *Address) SetStreet(x string)
- type Comp
- type CompOption
- type Meta
- type MetaOption
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"`
// FormattedAddress is the full address from Google.
// example:1600 Amphitheatre Parkway, Mountain View, CA 94043, USA
// required:false
FormattedAddress *string `json:"formatted_address" bson:"formatted_address" validate:"nonnilpointer"`
// PlaceName is the location’s name, often a landmark.
// example:Central Park
// required:false
PlaceName *string `json:"place_name" bson:"place_name" validate:"nonnilpointer"`
// Street is the address’s street number and name.
// example:1600 Amphitheatre Parkway
// required:false
Street *string `json:"street" bson:"street" validate:"nonnilpointer"`
// City is the address’s city or locality.
// example:Mountain View
// required:false
City *string `json:"city" bson:"city" validate:"nonnilpointer"`
// State is the address’s state, province, or region.
// example:CA
// required:false
State *string `json:"state" bson:"state" validate:"nonnilpointer"`
// PostalCode is the address’s postal code.
// example:94043
// required:false
PostalCode *string `json:"postal_code" bson:"postal_code" validate:"nonnilpointer"`
// Country is the address’s country.
// example:USA
// required:false
Country *string `json:"country" bson:"country" validate:"nonnilpointer"`
// Latitude is the location’s latitude, if available.
// example:37.4224764
// required:false
// format:double
Latitude *float64 `json:"latitude" bson:"latitude" validate:"nonnilpointer"`
// Longitude is the location’s longitude, if available.
// example:-122.0842499
// required:false
// format:double
Longitude *float64 `json:"longitude" bson:"longitude" validate:"nonnilpointer"`
// PlaceID is the Google Place ID for the location.
// example:ChIJ2eUgeAK6j4ARbn5u_wAGqWA
// required:false
PlaceID *string `json:"place_id" bson:"place_id" validate:"nonnilpointer"`
}
Address defines a location from Google’s place picker. swagger:model
func NewAddress ¶
func (*Address) GetCountry ¶
func (*Address) GetFormattedAddress ¶
func (*Address) GetLatitude ¶
func (*Address) GetLongitude ¶
func (*Address) GetPlaceID ¶
func (*Address) GetPlaceName ¶
func (*Address) GetPostalCode ¶
func (*Address) SetCountry ¶
func (*Address) SetFormattedAddress ¶
func (*Address) SetLatitude ¶
func (*Address) SetLongitude ¶
func (*Address) SetPlaceID ¶
func (*Address) SetPlaceName ¶
func (*Address) SetPostalCode ¶
type Comp ¶
type Comp struct {
// Timezone is the address’s timezone.
// example:America/Los_Angeles
// readOnly:true
Timezone *string `json:"timezone" bson:"timezone" validate:"nonnilpointer"`
}
func ApplyComp ¶
func ApplyComp(c *Comp, modifiers ...CompOption) Comp
func (*Comp) GetTimezone ¶
func (*Comp) SetTimezone ¶
type CompOption ¶
type CompOption = contract.CompOption[Comp]
func WithProcessedTimezone ¶
func WithTimezone ¶
func WithTimezone(tz string) CompOption
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.