Documentation ¶
Index ¶
- Variables
- func GenerateOpenAPIDocument()
- func OpenAPI3Schema() *openapi3.Swagger
- func OpenAPI3SchemaEncoded(encoding string) (encodedContent []byte, contentId string)
- func ValidateJSONResponse(request *http.Request, path string, status int, header http.Header, ...) error
- func ValidateJSONResponseAgainstJSONSchema(jsonResponse []byte, jsonSchema string) error
- type Bbox
- type CollectionInfo
- type CollectionsInfo
- type ConformanceClasses
- type Feature
- type FeatureCollection
- type Link
- type RootContent
Constants ¶
This section is empty.
Variables ¶
var BboxSchema openapi3.Schema = openapi3.Schema{ Type: "object", Required: []string{"bbox"}, Properties: map[string]*openapi3.SchemaRef{ "crs": { Value: openapi3.NewStringSchema(), }, "bbox": { Value: &openapi3.Schema{ Type: "array", MinItems: 4, MaxItems: &maxItems, Items: openapi3.NewSchemaRef("", openapi3.NewFloat64Schema().WithMin(-180).WithMax(180)), }, }, }, }
var CollectionInfoSchema openapi3.Schema = openapi3.Schema{ Type: "object", Required: []string{"name", "links"}, Properties: map[string]*openapi3.SchemaRef{ "name": { Value: &openapi3.Schema{ Type: "string", }, }, "title": { Value: &openapi3.Schema{ Type: "string", }, }, "description": { Value: &openapi3.Schema{ Type: "string", }, }, "links": { Value: &openapi3.Schema{ Type: "array", Items: &openapi3.SchemaRef{ Value: &LinkSchema, }, }, }, "extent": { Value: &BboxSchema, }, "crs": { Value: &openapi3.Schema{ Type: "array", Items: &openapi3.SchemaRef{ Value: &openapi3.Schema{ Type: "string", }, }, }, }, }, }
var CollectionsInfoSchema openapi3.Schema = openapi3.Schema{ Type: "object", Required: []string{"links", "collections"}, Properties: map[string]*openapi3.SchemaRef{ "links": { Value: &openapi3.Schema{ Type: "array", Items: &openapi3.SchemaRef{ Value: &LinkSchema, }, }, }, "collections": { Value: &openapi3.Schema{ Type: "array", Items: &openapi3.SchemaRef{ Value: &CollectionInfoSchema, }, }, }, }, }
var ConformanceClassesSchema openapi3.Schema = openapi3.Schema{ Type: "object", Required: []string{"conformsTo"}, Properties: map[string]*openapi3.SchemaRef{ "conformsTo": { Value: &openapi3.Schema{ Type: "array", Items: &openapi3.SchemaRef{ Value: &openapi3.Schema{ Type: "string", }, }, }, }, }, }
var FeatureCollectionJSONSchema string = `` /* 16871-byte string literal not displayed */
Collected from: http://geojson.org/schema/FeatureCollection.json 2018-04-02
var FeatureJSONSchema string = `` /* 13542-byte string literal not displayed */
Collected from http://geojson.org/schema/Feature.json on 2018-03-02
var LinkSchema openapi3.Schema = openapi3.Schema{ Type: "object", Required: []string{"href"}, Properties: map[string]*openapi3.SchemaRef{ "href": { Value: &openapi3.Schema{ Type: "string", }, }, "rel": { Value: &openapi3.Schema{ Type: "string", }, }, "type": { Value: &openapi3.Schema{ Type: "string", }, }, "hreflang": { Value: &openapi3.Schema{ Type: "string", }, }, "title": { Value: &openapi3.Schema{ Type: "string", }, }, }, }
Functions ¶
func GenerateOpenAPIDocument ¶
func GenerateOpenAPIDocument()
func OpenAPI3Schema ¶
func OpenAPI3SchemaEncoded ¶
func ValidateJSONResponse ¶
func ValidateJSONResponse(request *http.Request, path string, status int, header http.Header, respBodyRC io.ReadCloser) error
Validate a json response provided by a Reader using kin-openapi/openapi3 against the openapi3
scaffolding set up in wfs3/openapi3.go
func ValidateJSONResponseAgainstJSONSchema ¶
Validate a Reader providing the response body against a string json schema
Types ¶
type CollectionInfo ¶
type CollectionInfo struct { Name string `json:"name"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Links []*Link `json:"links"` Extent *Bbox `json:"extent,omitempty"` Crs []string `json:"crs,omitempty"` }
for collectionInfo schema
func CollectionMetaData ¶
func CollectionMetaData(name string, p *data_provider.Provider, serveAddress string, checkOnly bool) (content *CollectionInfo, contentId string, err error)
func (*CollectionInfo) ContentType ¶
func (ci *CollectionInfo) ContentType(contentType string)
type CollectionsInfo ¶
type CollectionsInfo struct { Links []*Link `json:"links"` Collections []*CollectionInfo `json:"collections"` }
--- @See https://raw.githubusercontent.com/opengeospatial/WFS_FES/master/core/openapi/schemas/content.yaml
for collectionsInfo schema.
func CollectionsMetaData ¶
func CollectionsMetaData(p *data_provider.Provider, serveAddress string, checkOnly bool) (content *CollectionsInfo, contentId string, err error)
func (*CollectionsInfo) ContentType ¶
func (csi *CollectionsInfo) ContentType(contentType string)
type ConformanceClasses ¶
type ConformanceClasses struct {
ConformsTo []string `json:"conformsTo"`
}
for ConformanceClasses schema
func Conformance ¶
func Conformance() (content *ConformanceClasses, contentId string)
--- Implements req/core/conformance-op
type Feature ¶
func FeatureData ¶
type FeatureCollection ¶
type FeatureCollection struct { geojson.FeatureCollection Self string `json:"self,omitempty"` Prev string `json:"prev",omitempty` Next string `json:"next",omitempty` }
func FeatureCollectionData ¶
func FeatureCollectionData(cName string, startIdx, stopIdx uint, p *data_provider.Provider, checkOnly bool) (content *FeatureCollection, more bool, contentId string, err error)
type Link ¶
type Link struct { Href string `json:"href"` Rel string `json:"rel"` Type string `json:"type"` Hreflang string `json:"hreflang"` Title string `json:"title"` }
--- @See https://raw.githubusercontent.com/opengeospatial/WFS_FES/master/core/openapi/schemas/link.yaml
for link schema
func (*Link) ContentType ¶
type RootContent ¶
type RootContent struct {
Links []*Link `json:"links"`
}
--- @See http://raw.githubusercontent.com/opengeospatial/WFS_FES/master/core/openapi/schemas/root.yaml
for rootContentSchema Definition
What the endpoint at "/" returns
func Root ¶
func Root(serveAddress string, checkOnly bool) (content *RootContent, contentId string)
checkOnly indicates that the caller doesn't care about the content, only the contentId contentId is a string that changes as the content changes, useful for ETag & caching.
func (RootContent) ContentType ¶
func (rc RootContent) ContentType(contentType string) RootContent