middlewares

package
v0.0.0-...-18ff29a Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultExpires 默认存活时间
	DefaultExpires = time.Hour * 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationOptions

type AuthenticationOptions struct {
	Key     string `json:"-" yaml:"key" mapstructure:"key"`
	Expires int64  `json:"-" yaml:"expires" mapstructure:"expires"`
	Cipher  string `json:"-" yaml:"cipher" mapstructure:"cipher"`
}

AuthenticationOptions 认证中间件配置项

type JWTMiddleware

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

JWTMiddleware : only use HMAC

func NewJWTMiddlewares

func NewJWTMiddlewares(logger *flog.Logger, opts AuthenticationOptions) *JWTMiddleware

NewJWTMiddlewares 生成JWT中间件

func (*JWTMiddleware) HandlerFunc

func (this *JWTMiddleware) HandlerFunc(c echo.Context) (err error)

HandlerFunc 生成路由处理函数, 主要用于请求路由生成token.

func (*JWTMiddleware) MiddlewareFunc

func (this *JWTMiddleware) MiddlewareFunc(next echo.HandlerFunc) echo.HandlerFunc

MiddlewareFunc 生成中间件函数

Jump to

Keyboard shortcuts

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