middlewares

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
	InfoContext(ctx context.Context, msg string, args ...any)
	WarnContext(ctx context.Context, msg string, args ...any)
	ErrorContext(ctx context.Context, msg string, args ...any)
}

type ReqLogger

type ReqLogger struct {
	// contains filtered or unexported fields
}

func NewReqLogger

func NewReqLogger(opts ...ReqLoggerOpt) *ReqLogger

func (*ReqLogger) ServeHTTP

func (mw *ReqLogger) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*ReqLogger) Wrap

func (mw *ReqLogger) Wrap(h http.Handler) http.Handler

type ReqLoggerOpt

type ReqLoggerOpt func(*ReqLogger)

func WithLogger

func WithLogger(logger Logger) ReqLoggerOpt

type RespCompressor

type RespCompressor struct {
	// contains filtered or unexported fields
}

func NewRespCompressor

func NewRespCompressor(opts ...RespCompressorOpt) *RespCompressor

func (*RespCompressor) ServeHTTP

func (mw *RespCompressor) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*RespCompressor) Wrap

func (mw *RespCompressor) Wrap(h http.Handler) http.Handler

type RespCompressorOpt

type RespCompressorOpt func(*RespCompressor)

func WithDeflate

func WithDeflate(level int) RespCompressorOpt

func WithGZip

func WithGZip(level int) RespCompressorOpt

Jump to

Keyboard shortcuts

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