model

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoEntity = errors.New("entity does not exist")
	ErrBadInput = errors.New("invalid input")
)

Functions

This section is empty.

Types

type Response

type Response struct {
	Status     string `json:"status"`
	Message    string `json:"message"`
	StatusCode int    `json:"code"`
}

Response describes a status response

func NewResponse

func NewResponse(msg string, code int) *Response

NewResponse creates a new status response based on parameters

type Tile

type Tile struct {
	Data     []byte
	Format   mbtiles.TileFormat
	Modified time.Time
	Hash     [32]byte
}

func GetGrid

func GetGrid(id, z, x, y string) (*Tile, error)

func GetTile

func GetTile(id, z, x, y string) (*Tile, error)

type TileJSON

type TileJSON struct {
	// TileJSON spec fields
	TileJSON    string     `json:"tilejson"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Version     string     `json:"version,omitempty"`
	Attribution string     `json:"attribution,omitempty"`
	Template    string     `json:"template,omitempty"`
	Legend      string     `json:"legend,omitempty"`
	Scheme      string     `json:"scheme,omitempty"`
	Tiles       []string   `json:"tiles"`
	Grids       []string   `json:"grids,omitempty"`
	Data        []string   `json:"data,omitempty"`
	MinZoom     int        `json:"minzoom,omitempty"`
	MaxZoom     int        `json:"maxzoom,omitempty"`
	Bounds      [4]float64 `json:"bounds,omitempty"`
	Center      [3]float64 `json:"center,omitempty"`

	// Custom fields
	Format string `json:"format,omitempty"`
	Type   string `json:"type,omitempty"`

	*mbtiles.LayerData `json:",omitempty"`
}

TileJSON describes a tileset in JSON format

func GetTileJSON

func GetTileJSON(id string, u *url.URL) (*TileJSON, error)

GetTileJSON returns a TileJSON by given tileset ID

Jump to

Keyboard shortcuts

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