middleware

package
v0.0.0-...-f4e968d Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultLoggerConfig is the default Logger middleware config.
	DefaultLoggerConfig = LoggerConfig{
		Skipper: echomw.DefaultSkipper,
		Output:  os.Stdout,
	}
)

Functions

func CheckSignin

func CheckSignin(next echo.HandlerFunc) echo.HandlerFunc

CheckSignin 检查用户是否登录的middleware

func ContextExtend

func ContextExtend(h echo.HandlerFunc) echo.HandlerFunc

ContextExtend 扩展context中间件

func Logrus

func Logrus() echo.MiddlewareFunc

Logrus returns a middleware that logs HTTP requests.

func LogrusDefaultConfig

func LogrusDefaultConfig(config LoggerConfig) echo.MiddlewareFunc

LogrusDefaultConfig returns a Logrus middleware with default config.

Types

type LoggerConfig

type LoggerConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper echomw.Skipper

	// Output is a writer where logs in JSON format are written.
	// Optional. Default value os.Stdout.
	Output io.Writer
	// contains filtered or unexported fields
}

LoggerConfig defines the config for Logger middleware.

Jump to

Keyboard shortcuts

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