middleware

package
v0.0.0-...-958ca29 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logging

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

Logging is a middleware which logs response status and time in microseconds along with other data.

func Tracer

func Tracer(inner http.Handler) http.Handler

Types

type LogLine

type LogLine struct {
	ID           string
	StartTime    string
	ResponseTime int64
	Method       string
	UserAgent    string
	IP           string
	URI          string
	Response     int
}

func (*LogLine) String

func (l *LogLine) String() string

type StatusResponseWriter

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

Define own Response Writer to be used for logging of status - as http.ResponseWriter does not let us read status.

func (*StatusResponseWriter) WriteHeader

func (w *StatusResponseWriter) WriteHeader(status int)

Jump to

Keyboard shortcuts

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