package
0.0.0-20200826225843-05a1c048ef13
Repository: https://github.com/go-spatial/tegola-postgis.git
Documentation: pkg.go.dev

# README

Server

The server package is responsible for handling webserver requests for map tiles and various JSON endpoints describing the configured server. Example config:

[webserver]
port = ":9090"              # set something different than default ":8080"
ssl_cert = "fullchain.pem"  # ssl cert for serving by https
ssl_key = "privkey.pem"     # ssl key for serving by https


[webserver.headers]
Access-Control-Allow-Origin = "*"

Config properties

  • port (string): [Optional] Port and bind string. For example ":9090" or "127.0.0.1:9090". Defaults to ":8080"
  • hostname (string): [Optional] The hostname to use in the various JSON endpoints. This is useful if tegola is behind a proxy and can't read the API consumer's request host directly.
  • uri_prefix (string): [Optional] A prefix to add to all API routes. This is useful when tegola is behind a proxy (i.e. example.com/tegola). The prexfix will be added to all URLs included in the capabilities endpoint responses.
  • ssl_cert (string): [Optional, unless ssl_key provided] Path to a certificate file for serving through HTTPS
  • ssl_key (string): [Optional, unless ssl_cert provided] Path to a private key file for serving through HTTPS

Local development of the embedded viewer

Tegola's built in viewer code is stored in the static/ directory. In order to embed the static files into the tegola binary the package go-bindata is used. Once go-bindata is installed the following command can be used to generate a .go file for inclusion in the tegola binary:

go-bindata -pkg=bindata -o=bindata/bindata.go -ignore=.DS_Store static/...

go-bindata also supports a debug mode which is descried as "Do not embed the assets, but provide the embedding API. Contents will still be loaded from disk." This mode is ideal for development and can be configured using the following command:

go-bindata -debug -pkg=bindata -o=bindata/bindata.go -ignore=.DS_Store static/...

Disabling the viewer

The viewer can be excluded during building by using the build flag noViewer. For example, building tegola from the cmd/tegola directory:

go build -tags "noViewer"

# Packages

No description provided by the author

# Functions

GZipHandler is responsible for determining if the incoming request should be served gzipped data.
HeadersHandler is middleware for adding user defined response headers.
NewRouter set's up the our routes.
Start starts the tile server binding to the provided port.
TileCacheHandler implements a request cache for tiles on requests when the URLs have a /:z/:x/:y scheme suffix (i.e.

# Constants

MaxTileSize is 500k.

# Variables

DefaultCORSHeaders define the default CORS response headers added to all requests.
Headers is the map of user defined response headers.
HostName is the name of the host to use for construction of URLS.
Port is the port the server is listening on, used for construction of URLS.
SSLCert is a filepath to an SSL cert, this will be used to enable https.
SSLKey is a filepath to an SSL key, this will be used to enable https.
URIPrefix sets a prefix on all server endpoints.
URLRoot builds a string containing the scheme, host and port based on a combination of user defined values, headers and request parameters.
Version is the version of the software, this should be set by the main program, before starting up.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author