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 生成中间件函数
Click to show internal directories.
Click to hide internal directories.