Documentation
¶
Index ¶
- Constants
- Variables
- type Base
- func (b *Base) Query(api, version, mode, query string, v *url.Values, inst interface{}) error
- func (b *Base) QueryBase(query string, v *url.Values, inst interface{}) error
- func (b *Base) QueryRequest(query string, v *url.Values) (*http.Response, error)
- func (b *Base) QueryWithBody(api, version, mode, query string, v *url.Values, body interface{}, ...) error
- func (b *Base) QueryWithBodyBase(queryString string, v *url.Values, body interface{}, inst interface{}) error
- func (b *Base) SetDebug(debug bool)
- type BoundingBox
- type Context
- type Feature
- type FeatureCollection
- type Geometry
- type Location
- type MapboxApiMessage
- type Point
- type Properties
Constants ¶
View Source
const (
// BaseURL Mapbox API base URL
BaseURL = "https://api.mapbox.com"
)
Variables ¶
View Source
var ErrorAPILimitExceeded = errors.New("Mapbox API error api rate limit exceeded")
ErrorAPILimitExceeded indicates the API limit has been exceeded
ErrorAPIUnauthorized indicates authorization failed
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base Mapbox API base
func (*Base) QueryBase ¶ added in v0.2.0
QueryBase Query the mapbox API and fill the provided instance with the returned JSON TODO: Rename this
func (*Base) QueryRequest ¶ added in v0.2.0
QueryRequest make a get with the provided query string and return the response if successful
func (*Base) QueryWithBody ¶ added in v0.5.0
func (b *Base) QueryWithBody(api, version, mode, query string, v *url.Values, body interface{}, inst interface{}) error
QueryWithBody makes a POST request with JSON body and returns the response
type BoundingBox ¶
type BoundingBox []float64
type Feature ¶
type Feature struct {
ID string `json:"id"`
Type string `json:"type"`
Text string `json:"text"`
PlaceName string `json:"place_name"`
PlaceType []string `json:"place_type"`
Relevance float64 `json:"relevance"`
Properties Properties `json:"properties"`
BBox BoundingBox `json:"bbox"`
Center Point `json:"center"`
Geometry Geometry `json:"geometry"`
Context []Context `json:"context"`
}
type FeatureCollection ¶
type MapboxApiMessage ¶ added in v0.3.0
type MapboxApiMessage struct {
Message string
}
Click to show internal directories.
Click to hide internal directories.