middleware

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminOnly

func AdminOnly(s sessions.Store, loggedDB db.LoggedDB) func(h http.Handler) http.Handler

AdminOnly rejects user with invalid loginToken Stores username in context

func Cors

func Cors(h http.Handler) http.Handler

Cors ...

func LoggedOnly

func LoggedOnly(s sessions.Store, loggedDB db.LoggedDB) func(h http.Handler) http.Handler

LoggedOnly rejects user with invalid loginToken Stores username in context

func Logger

func Logger(h http.Handler) http.Handler

Logger ...

Types

type ResponseWithCode

type ResponseWithCode struct {
	http.ResponseWriter
	Code int
}

ResponseWithCode ...

func NewResponseWithCode

func NewResponseWithCode(w http.ResponseWriter) *ResponseWithCode

NewResponseWithCode ...

func (*ResponseWithCode) WriteHeader

func (r *ResponseWithCode) WriteHeader(statuscode int)

WriteHeader ...

Jump to

Keyboard shortcuts

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