entities

package
v0.0.0-...-a413825 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConfigured

func IsConfigured() bool

IsConfigured returns if the service is configured

Types

type Error

type Error struct {
	Code    int
	Message string
	Errors  []GeolocateError
}

Error ...

type GeolocateError

type GeolocateError struct {
	Domain  string
	Reason  string
	Message string
}

GeolocateError ...

type GeolocateResponse

type GeolocateResponse struct {
	Results []GeolocateResult
}

GeolocateResponse ...

type GeolocateResult

type GeolocateResult struct {
	FormattedAddress string `json:"formatted_address"`
	Geometry         Geometry
}

GeolocateResult ...

type Geometry

type Geometry struct {
	Location     Location
	LocationType string `json:"location_type"`
}

Geometry ...

type GoogleMapsAPI

type GoogleMapsAPI struct {
	Client *maps.Client
}

GoogleMapsAPI ...

func NewGoogleGeo

func NewGoogleGeo() (*GoogleMapsAPI, error)

NewGoogleGeo ...

type JSONRequest

type JSONRequest struct {
	Lat      string `json:"lat"`
	Lng      string `json:"lng"`
	Distance string `json:"distance"`
	Pricing  string `json:"pricing"`
}

JSONRequest ...

type Jsonable

type Jsonable interface {
	ToJSON() (json.RawMessage, error)
}

Jsonable an entity that returns a JSON representation of itself

type Location

type Location struct {
	Lat float64
	Lng float64
}

Location ...

type Place

type Place struct {
	Address    string      `json:"address"`
	Location   maps.LatLng `json:"location"`
	Name       string      `json:"name"`
	Phone      string      `json:"phone"`
	Rating     float32     `json:"rating"`
	Schedule   string      `json:"schedule"`
	PriceLevel int         `json:"price_level"`
	Types      string      `json:"types"`
}

Place ...

func PlaceFrom

func PlaceFrom(details maps.PlacesSearchResult) Place

PlaceFrom ...

func (Place) ToJSON

func (p Place) ToJSON() (json.RawMessage, error)

ToJSON returns a JSON representation of Place

type Point

type Point struct {
	Lat          float64
	Lng          float64
	Address      string
	LocationType string
}

Point ...

func NewPoint

func NewPoint(lat, lng float64) *Point

NewPoint ...

type SearchRequest

type SearchRequest struct {
	Lat      float64 `json:"lat"`
	Lng      float64 `json:"lng"`
	Distance uint    `json:"distance"`
	Pricing  int     `json:"pricing"`
}

SearchRequest ...

func NewFromJSON

func NewFromJSON(bodyBytes []byte) (sr SearchRequest, err error)

NewFromJSON loads a Location from the request Body

Jump to

Keyboard shortcuts

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