middleware

package
v0.0.0-...-08d4403 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthenticated

func IsAuthenticated(next http.Handler) http.Handler

IsAuthenticated is an authentication middleware to validate user session when calling authenticated routes

func LogHTTPRequest

func LogHTTPRequest(next http.Handler) http.Handler

LogHTTPRequest is a logging middleware which logs request and response information like method, protocol, URI, etc.

Types

type HTTPLogInfo

type HTTPLogInfo struct {
	Method        string
	Proto         string
	URI           string
	IPAddr        string
	Host          string
	UserID        string
	StatusCode    int
	ContentLength int64
	Date          string
	Duration      time.Duration
	UserAgent     string
}

HTTPLogInfo struct stores request and response related data which needs to be logged

Jump to

Keyboard shortcuts

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