middleware

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultZapConfig = ZapConfig{
	Fields: []string{
		"id", "remote_ip", "host", "method", "uri", "user_agent", "status",
		"error", "latency", "latency_human", "bytes_in", "bytes_out",
	},
}

DefaultZapConfig is the default Zap middleware config.

Functions

func ErrTransWithConfig

func ErrTransWithConfig(conf ErrTransConfig) echo.MiddlewareFunc

ErrTransWithConfig returns echo.MiddlewareFunc.

func ZapWithConfig

func ZapWithConfig(cfg ZapConfig) echo.MiddlewareFunc

ZapWithConfig returns echo.MiddlewareFunc.

Types

type ErrTransConfig

type ErrTransConfig struct {
	Skipper    middleware.Skipper
	Translator *ut.UniversalTranslator
}

ErrTransConfig defines the config for ErrTransWithConfig middleware.

type ZapConfig

type ZapConfig struct {
	// Logged fields.
	//
	// - id (Request ID)
	// - remote_ip
	// - host
	// - method
	// - uri
	// - path
	// - protocol
	// - referer
	// - user_agent
	// - status
	// - error
	// - latency (In nanoseconds)
	// - latency_human (Human readable)
	// - bytes_in (Bytes received)
	// - bytes_out (Bytes sent)
	// - header:<NAME>
	// - query:<NAME>
	// - form:<NAME>
	//
	// Optional. Default value DefaultZapConfig.Fields.
	Fields []string

	// Skipper defines a function to skip middleware.
	Logger *zap.Logger

	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper
}

ZapConfig defines the config for AccessWithConfig middleware.

Jump to

Keyboard shortcuts

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