middleware

package
v0.0.0-...-0eec0e3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authentication

func Authentication(h http.HandlerFunc) http.HandlerFunc

func Authorization

func Authorization(roles ...int) func(http.HandlerFunc) http.HandlerFunc

func EnableCORS

func EnableCORS(h http.Handler) http.Handler

func Logging

func Logging(logger glog.Logger) func(inner http.Handler) http.Handler

Logging is a handler that log request information

func RequestID

func RequestID(h http.Handler) http.Handler

func RoleCheck

func RoleCheck(r *http.Request, roles ...int) bool

func StaticCache

func StaticCache(h http.Handler, maxAge int) http.Handler

func StatusResponseWriter

func StatusResponseWriter(h http.Handler) http.Handler

StatusResponseWriter wrap go response writer with a record of the http return status

Types

type JWTConf

type JWTConf struct {
	PrivateKey string `envconfig:"PRIVATE_KEY"`
}

type MyResponseWriter

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

func (*MyResponseWriter) Status

func (w *MyResponseWriter) Status() int

func (*MyResponseWriter) WriteHeader

func (w *MyResponseWriter) WriteHeader(code int)

Jump to

Keyboard shortcuts

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