Documentation ¶
Overview ¶
Package server implements the http frontend
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func Start(port string)
- func TileCacheHandler(next http.Handler) http.Handler
- type Capabilities
- type CapabilitiesLayer
- type CapabilitiesMap
- type HandleCapabilities
- type HandleMapCapabilities
- type HandleMapLayerZXY
- type HandleMapStyle
- type HandleMapZXY
- type Logger
Constants ¶
const DefaultLogFormat = "{{.Time}}:{{.RequestIP}} —— Tile:{{.Z}}/{{.X}}/{{.Y}}"
const ( // MaxTileSize is 500k. Currently just throws a warning when tile // is larger than MaxTileSize MaxTileSize = 500000 )
Variables ¶
Functions ¶
func Asset ¶ added in v0.4.0
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶ added in v0.4.0
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶ added in v0.4.0
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetNames ¶ added in v0.4.0
func AssetNames() []string
AssetNames returns the names of the assets.
func MustAsset ¶ added in v0.4.0
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶ added in v0.4.0
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶ added in v0.4.0
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Capabilities ¶ added in v0.3.0
type Capabilities struct { Version string `json:"version"` Maps []CapabilitiesMap `json:"maps"` }
type CapabilitiesLayer ¶ added in v0.3.0
type CapabilitiesMap ¶ added in v0.3.0
type HandleCapabilities ¶ added in v0.3.0
type HandleCapabilities struct{}
func (HandleCapabilities) ServeHTTP ¶ added in v0.3.0
func (req HandleCapabilities) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HandleMapCapabilities ¶ added in v0.3.1
type HandleMapCapabilities struct {
// contains filtered or unexported fields
}
func (HandleMapCapabilities) ServeHTTP ¶ added in v0.3.1
func (req HandleMapCapabilities) ServeHTTP(w http.ResponseWriter, r *http.Request)
returns details about a map according to the tileJSON spec (https://github.com/mapbox/tilejson-spec/tree/master/2.1.0)
URI scheme: /capabilities/:map_name.json
map_name - map name in the config file
type HandleMapLayerZXY ¶ added in v0.3.1
type HandleMapLayerZXY struct {
// contains filtered or unexported fields
}
func (HandleMapLayerZXY) ServeHTTP ¶ added in v0.3.1
func (req HandleMapLayerZXY) ServeHTTP(w http.ResponseWriter, r *http.Request)
URI scheme: /maps/:map_name/:layer_name/:z/:x/:y map_name - map name in the config file layer_name - name of the single map layer to render z, x, y - tile coordinates as described in the Slippy Map Tilenames specification
z - zoom level x - row y - column
type HandleMapStyle ¶ added in v0.4.0
type HandleMapStyle struct {
// contains filtered or unexported fields
}
func (HandleMapStyle) ServeHTTP ¶ added in v0.4.0
func (req HandleMapStyle) ServeHTTP(w http.ResponseWriter, r *http.Request)
returns details about a map according to the tileJSON spec (https://github.com/mapbox/tilejson-spec/tree/master/2.1.0)
URI scheme: /capabilities/:map_name.json
map_name - map name in the config file
type HandleMapZXY ¶ added in v0.3.1
type HandleMapZXY struct {
// contains filtered or unexported fields
}
func (HandleMapZXY) ServeHTTP ¶ added in v0.3.1
func (req HandleMapZXY) ServeHTTP(w http.ResponseWriter, r *http.Request)
URI scheme: /maps/:map_name/:z/:x/:y map_name - map name in the config file z, x, y - tile coordinates as described in the Slippy Map Tilenames specification
z - zoom level x - row y - column