operations

package
v0.0.0-...-59b36d8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindMissingParams

func FindMissingParams(query url.Values, queryParams []string) []string

FindMissingParams compares the url.Values with the given keys and checks if any are missing

func ProcessRequest

func ProcessRequest(config *Config, w http.ResponseWriter, r *http.Request) bool

ProcessRequest checks the quality of the request and if it's valid to process as a WMTS request

func SendError

func SendError(e Exception, w http.ResponseWriter, r *http.Request)

SendError writes the error message to the response

Types

type Config

type Config struct {
	Host     string
	Template string
	Logging  bool
}

Config used for storing application startup parameters

type Exception

type Exception interface {
	Error() string
	Code() string
	Status() int
}

Exception interfact wraps three variables: Error Code Status Needed for WMTS error responses

func InvalidParameterValue

func InvalidParameterValue(parameter string) Exception

func MissingParameterValue

func MissingParameterValue(value string) Exception

MissingParameterValue template

func ProcessGetCapabilitiesRequest

func ProcessGetCapabilitiesRequest(config *Config, w http.ResponseWriter, r *http.Request) Exception

ProcessGetCapabilitiesRequest if a template is given this will fill it in and writes it to the response

func ProcessGetFeatureInfoRequest

func ProcessGetFeatureInfoRequest(w http.ResponseWriter, r *http.Request) Exception

ProcessGetFeatureInfoRequest - Translates KVP requests to RestFUL requests

func ProcessGetTileRequest

func ProcessGetTileRequest(w http.ResponseWriter, r *http.Request) Exception

ProcessGetTileRequest rewrites the KVP request as RestFUL and alters the request so it can be proxied

func UnknownService

func UnknownService() Exception

UnknownService template

type HostAndPath

type HostAndPath struct {
	Protocol string
	Host     string
	Path     string
}

HostAndPath is HostAndPath

type WMTSException

type WMTSException struct {
	ErrorMessage string
	ErrorCode    string
	StatusCode   int
}

WMTSException grouping the error message variables together

func (WMTSException) Code

func (w WMTSException) Code() string

Code returns available ErrorCode

func (WMTSException) Error

func (w WMTSException) Error() string

Error returns available ErrorMessage

func (WMTSException) Status

func (w WMTSException) Status() int

Status returns available StatusCode

Jump to

Keyboard shortcuts

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