http

package
v0.0.0-...-6cd7eb2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRouter

func CreateRouter(api *models.API) *mux.Router

CreateRouter creates a new mux.Router and sets up all endpoints defined in the SensorThings api

func LowerCaseURI

func LowerCaseURI(h http.Handler) http.Handler

LowerCaseURI is a middleware function that lower cases the url path

func PostProcessHandler

func PostProcessHandler(h http.Handler, externalURI string) http.Handler

PostProcessHandler runs after all the other handlers and can be used to modify the response. In this case modify links (due to proxy running) or handle CORS functionality Basically we catch all the response using httptest.NewRecorder (headers + body), modify and write to response. Is this a right approach?

func RequestErrorHandler

func RequestErrorHandler(h http.Handler) http.Handler

RequestErrorHandler is a middleware function that lower cases the url path

Types

type GostServer

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

GostServer is the type that contains all of the relevant information to set up the GOST HTTP Server

func (*GostServer) Start

func (s *GostServer) Start()

Start command to start the GOST HTTPServer

func (*GostServer) Stop

func (s *GostServer) Stop()

Stop command to stop the GOST HTTP server

type Server

type Server interface {
	Start()
	Stop()
}

Server interface for starting and stopping the HTTP server

func CreateServer

func CreateServer(host string, port int, api *models.API, https bool, httpsCert, httpsKey string) Server

CreateServer initialises a new GOST HTTPServer based on the given parameters

Jump to

Keyboard shortcuts

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