web

package
v0.0.0-...-c41dffb Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 11 Imported by: 2

Documentation

Overview

Package web - simple HTTP Wrapper

Package web - Simple HTTP Wrapper

Package web - simple HTTP Wrapper

Package web - simple HTTP Wrapper

Index

Constants

View Source
const VERSION string = "0.8.0"

VERSION provides the supported version of the STAC API specification.

Variables

View Source
var SwaggerHTML = `` /* 1737-byte string literal not displayed */

Functions

func CSW3OpenSearchHandler

func CSW3OpenSearchHandler(w http.ResponseWriter, r *http.Request, cat *geocatalogo.GeoCatalogue)

CSW3OpenSearchHandler provides a default HTTP API

func CSW3OpenSearchRouter

func CSW3OpenSearchRouter(cat *geocatalogo.GeoCatalogue) *mux.Router

CSW3OpenSearchRouter provides CSW 3 OpenSearch Routing

func EmitResponseNotOK

func EmitResponseNotOK(w http.ResponseWriter, contentType string, prettyPrint bool, exception *search.Exception)

EmitResponseNotOK provides HTTP response for unsuccessful requests

func EmitResponseOK

func EmitResponseOK(w http.ResponseWriter, contentType string, prettyPrint bool, results *search.Results)

EmitResponseOK provides HTTP response for successful requests

func Results2STACFeatureCollection

func Results2STACFeatureCollection(limit int, url string, r *search.Results, s *STACFeatureCollection)

func STACAPIDescription

func STACAPIDescription(w http.ResponseWriter, r *http.Request, cat *geocatalogo.GeoCatalogue)

STACAPIDescription provides the API description

func STACCollections

func STACCollections(w http.ResponseWriter, r *http.Request, cat *geocatalogo.GeoCatalogue)

STACCollections provides STAC compliant collection descriptions

func STACItems

func STACItems(w http.ResponseWriter, r *http.Request, cat *geocatalogo.GeoCatalogue)

STACItems provides STAC compliant Items matching filters

func STACOpenAPI

func STACOpenAPI(w http.ResponseWriter, r *http.Request, cat *geocatalogo.GeoCatalogue)

STACOpenAPI generates an OpenAPI document or Swagger representation

func STACRouter

func STACRouter(cat *geocatalogo.GeoCatalogue) *mux.Router

STACRouter provides STAC API Routing

Types

type Link struct {
	Rel   string `json:"rel"`
	Type  string `json:"type,omitempty"`
	Title string `json:"title,omitempty"`
	Href  string `json:"href"`
}

type Properties

type Properties struct {
	// contains filtered or unexported fields
}

type STACCatalogDefinition

type STACCatalogDefinition struct {
	Version     string `json:"stac_version"`
	Id          string `json:"id"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description"`
	Links       []Link `json:"links"`
}

type STACFeatureCollection

type STACFeatureCollection struct {
	Type           string         `json:"type"`
	Features       []STACItem     `json:"features"`
	Links          []Link         `json:"links"`
	NumberMatched  int            `json:"numberMatched"`
	NumberReturned int            `json:"numberReturned"`
	SearchMetadata SearchMetadata `json:"search:metadata"`
}

type STACItem

type STACItem struct {
	Type        string              `json:"type,omitempty"`
	Id          string              `json:"id,omitempty"`
	StacVersion string              `json:"stac_version"`
	BBox        [4]float64          `json:"bbox,omitempty"`
	Geometry    metadata.Geometry   `json:"geometry,omitempty"`
	Properties  metadata.Properties `json:"properties,omitempty"`
	Links       []Link              `json:"links,omitempty"`
	Assets      map[string]Link     `json:"assets,omitempty"`
}

type STACSearch

type STACSearch struct {
	Limit       int        `json:"limit,omitempty"`
	Datetime    string     `json:"datetime,omitempty"`
	Collections []string   `json:"collections,omitempty"`
	Bbox        [4]float64 `json:"bbox,omitempty"`
}

type SearchMetadata

type SearchMetadata struct {
	Next     string `json:"next"`
	Returned int    `json:"returned"`
	Limit    int    `json:"limit,omitempty"`
	Matched  int    `json:"matched,omitempty"`
}

Jump to

Keyboard shortcuts

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