middlewares

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Method      = 1 << 0 // 0. LogMethod
	RemoteAddr  = 1 << 1 // 1. LogRemoteAddr
	RequestID   = 1 << 2 // 2. LogRequestID
	UserAgent   = 1 << 3 // 3. LogUserAgent
	Query       = 1 << 4 // 4. Query
	ContentType = 1 << 5 // 5. LogContentType
	Request     = 1 << 6 // 6. Request

	Response            = 1 << 10          // 10. LogResponse
	ResponseContentType = 1<<11 + Response // 11. LogResponseContentType (+10)
	ResponseLength      = 1<<12 + Response // 12. LogResponseLength (+10)
	ResponseStatus      = 1<<13 + Response // 13. LogResponseStatus (+10)

	Duration = 1 << 15 // 15. LogDuration
)

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(log *slog.Logger, opts ...LoggingOptions) httputils.Middleware

Types

type Key_

type Key_ string

type LoggingOptions

type LoggingOptions uint16
var AllOptions LoggingOptions = math.MaxUint16

func (LoggingOptions) LogContentType

func (o LoggingOptions) LogContentType() bool

func (LoggingOptions) LogDuration

func (o LoggingOptions) LogDuration() bool

func (LoggingOptions) LogMethod

func (o LoggingOptions) LogMethod() bool

func (LoggingOptions) LogQuery

func (o LoggingOptions) LogQuery() bool

func (LoggingOptions) LogRemoteAddr

func (o LoggingOptions) LogRemoteAddr() bool

func (LoggingOptions) LogRequest

func (o LoggingOptions) LogRequest() bool

func (LoggingOptions) LogRequestID

func (o LoggingOptions) LogRequestID() bool

func (LoggingOptions) LogResponse

func (o LoggingOptions) LogResponse() bool

func (LoggingOptions) LogResponseContentType

func (o LoggingOptions) LogResponseContentType() bool

func (LoggingOptions) LogResponseLength

func (o LoggingOptions) LogResponseLength() bool

func (LoggingOptions) LogResponseStatus

func (o LoggingOptions) LogResponseStatus() bool

func (LoggingOptions) LogUserAgent

func (o LoggingOptions) LogUserAgent() bool

Jump to

Keyboard shortcuts

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