config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

config loads and understands the tegola config format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	//	the tile buffer to use
	TileBuffer int64 `toml:"tile_buffer"`
	// LocationName is the file name or http server that the config was read from.
	// If this is an empty string, it means that the location was unknown. This is the case if
	// the Parse() function is used directly.
	LocationName string
	Webserver    Webserver              `toml:"webserver"`
	Cache        map[string]interface{} `toml:"cache"`
	// Map of providers.
	Providers []map[string]interface{}
	Maps      []Map
}

Config represents a tegola config file.

func Load

func Load(location string) (conf Config, err error)

Load will load and parse the config file from the given location.

func LoadAndValidate added in v0.6.0

func LoadAndValidate(filename string) (cfg Config, err error)

func Parse

func Parse(reader io.Reader, location string) (conf Config, err error)

Parse will parse the Tegola config file provided by the io.Reader.

func (*Config) Validate

func (c *Config) Validate() error

checks the config for issues

type ErrInvalidProviderLayerName

type ErrInvalidProviderLayerName struct {
	ProviderLayerName string
}

func (ErrInvalidProviderLayerName) Error

type ErrMapNotFound

type ErrMapNotFound struct {
	MapName string
}

func (ErrMapNotFound) Error

func (e ErrMapNotFound) Error() string

type ErrMissingEnvVar added in v0.6.0

type ErrMissingEnvVar struct {
	EnvVar string
}

func (ErrMissingEnvVar) Error added in v0.6.0

func (e ErrMissingEnvVar) Error() string

type ErrOverlappingLayerZooms

type ErrOverlappingLayerZooms struct {
	ProviderLayer1 string
	ProviderLayer2 string
}

func (ErrOverlappingLayerZooms) Error

func (e ErrOverlappingLayerZooms) Error() string

type Map

type Map struct {
	Name        string     `toml:"name"`
	Attribution string     `toml:"attribution"`
	Bounds      []float64  `toml:"bounds"`
	Center      [3]float64 `toml:"center"`
	Layers      []MapLayer `toml:"layers"`
}

A Map represents a map in the Tegola Config file.

type MapLayer

type MapLayer struct {
	//	Name is optional. If it's not defined the name of the ProviderLayer will be used.
	//	Name can also be used to group multiple ProviderLayers under the same namespace.
	Name          string      `toml:"name"`
	ProviderLayer string      `toml:"provider_layer"`
	MinZoom       int         `toml:"min_zoom"`
	MaxZoom       int         `toml:"max_zoom"`
	DefaultTags   interface{} `toml:"default_tags"`
	//	DontSimplify indicates wheather feature simplification should be applied.
	//	We use a negative in the name so the default is to simplify
	DontSimplify bool `toml:"dont_simplify"`
}

type Webserver

type Webserver struct {
	HostName          string `toml:"hostname"`
	Port              string `toml:"port"`
	CORSAllowedOrigin string `toml:"cors_allowed_origin"`
}

Jump to

Keyboard shortcuts

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