model

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 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

func SetInitAsFailed

func SetInitAsFailed()

Types

type Health

type Health struct {
	OK bool `json:"ok"`
}

Health represents the object of the health root endpoint

func GetHealth

func GetHealth() *Health

GetHealth performs a self-check and returns the result

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 Status

type Status int

Status represents the status code of a service

const (
	// OK status if all checks were successful
	OK Status = iota

	// Warning status if non-critical issues are discovered
	Warning

	// Failure status when critical problems are discovered
	Failure
)

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