httphandling

package
v0.0.0-...-9b50a1c Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIVersion is the version prefix on the ReST URL
	APIVersion = "v1"
)

Variables

This section is empty.

Functions

func ListenAndServeTLS

func ListenAndServeTLS(addr string, handler http.Handler) error

ListenAndServeTLS starts a HTTPS listener with an auto generated self signed certificate.

func NewRouter

func NewRouter(c *config.Config) *mux.Router

NewRouter returns a newly configured HTTP mux router.

func WrapCommonHandler

func WrapCommonHandler(inner http.Handler, c *config.Config) http.Handler

WrapCommonHandler wraps the handler in the authentication handler if required and the accessLogger wrapper.

Types

type JSONGenericResponse

type JSONGenericResponse struct {
	Message  string
	HTTPCode int
}

JSONGenericResponse is a generic JSON response structure

type ResponseWriterWrapper

type ResponseWriterWrapper struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

ResponseWriterWrapper is a wapper for the response writer

func NewResponseWriterWrapper

func NewResponseWriterWrapper(w http.ResponseWriter) *ResponseWriterWrapper

NewResponseWriterWrapper returns a ResponseWriterWrapper

func (*ResponseWriterWrapper) Status

func (w *ResponseWriterWrapper) Status() int

Status returns the status code

func (*ResponseWriterWrapper) Write

func (w *ResponseWriterWrapper) Write(p []byte) (int, error)

Write to the ResponseWriterWrapper

func (*ResponseWriterWrapper) WriteHeader

func (w *ResponseWriterWrapper) WriteHeader(code int)

WriteHeader writes the status code header

Jump to

Keyboard shortcuts

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