middleware

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

README

echo-middleware

This project provides a collection of echo middleware used in API / Web projects.

GitHub Actions status Go Report Card Documentation

License

This code was authored by Mark Wolfe and licensed under the Apache 2.0 license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoCache added in v1.4.0

func NoCache() echo.MiddlewareFunc

NoCache returns a middleware which sets the no cache headers with default configuration.

func NoCacheWithConfig added in v1.4.0

func NoCacheWithConfig(config NoCacheConfig) echo.MiddlewareFunc

NoCacheWithConfig returns a middleware which sets a number of http headers to ensure the resource is not cached.

As per http://wiki.nginx.org/HttpProxyModule - NoCache sets:

Expires: Thu, 01 Jan 1970 00:00:00 UTC
Cache-Control: no-cache, private, max-age=0
X-Accel-Expires: 0
Pragma: no-cache (for HTTP/1.0 proxies/clients)

func ZeroLogRequestLog added in v1.1.0

func ZeroLogRequestLog() echo.MiddlewareFunc

ZeroLogRequestLog returns a request logger middleware with default config.

func ZeroLogRequestLogWithConfig added in v1.1.0

func ZeroLogRequestLogWithConfig(config ZeroLogRequestLogConfig) echo.MiddlewareFunc

ZeroLogRequestLogWithConfig returns a request logger middleware with config.

func ZeroLogWithConfig

func ZeroLogWithConfig(cfg ZeroLogConfig) echo.MiddlewareFunc

ZeroLogWithConfig setup and return an echo middleware with zerolog logger available from the context.Context.

Types

type NoCacheConfig added in v1.3.0

type NoCacheConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper
}

NoCacheConfig used to configure the no cache middleware

type ZeroLogConfig

type ZeroLogConfig struct {
	Caller bool
	Level  zerolog.Level
	Output io.Writer
	Logger zerolog.Logger
	Fields map[string]interface{}
}

ZeroLogConfig used to configure the zerolog echo middleware

type ZeroLogRequestLogConfig added in v1.1.0

type ZeroLogRequestLogConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper
}

ZeroLogRequestLogConfig defines the config for the request logger middleware

Jump to

Keyboard shortcuts

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