Documentation
¶
Index ¶
- Constants
- func AuthorizationParse(token string) (string, string)
- func GetMiddlewareManger() *middlewareManager
- func GetRoleMiddleware() *roleMiddleware
- func GetTokenMiddleware() *tokenMiddleware
- func Register(name string, mid Middleware) *middlewareManager
- type AttachTicketMiddleware
- func (this *AttachTicketMiddleware) FilterWrapper(fn func(ctx *context.Context) bool, next func(ctx *context.Context) bool) func(ctx *context.Context) bool
- func (this *AttachTicketMiddleware) GetHandler() beego.FilterFunc
- func (this *AttachTicketMiddleware) Init()
- func (this *AttachTicketMiddleware) Middleware() string
- func (this *AttachTicketMiddleware) Register(args ...interface{})
- func (this *AttachTicketMiddleware) SetHandler(handlers ...func(ctx *context.Context) bool) Middleware
- func (this *AttachTicketMiddleware) Wrapper(fn func(ctx *context.Context) bool, next func(ctx *context.Context) bool) func(ctx *context.Context)
- type AuthMiddleware
- type CorsMiddleware
- func (this *CorsMiddleware) FilterWrapper(fn func(ctx *context.Context) bool, next func(ctx *context.Context) bool) func(ctx *context.Context) bool
- func (this *CorsMiddleware) GetHandler() beego.FilterFunc
- func (this *CorsMiddleware) Init()
- func (this *CorsMiddleware) Middleware() string
- func (this *CorsMiddleware) Register(args ...interface{})
- func (this *CorsMiddleware) SetHandler(handlers ...func(ctx *context.Context) bool) Middleware
- func (this *CorsMiddleware) Wrapper(fn func(ctx *context.Context) bool, next func(ctx *context.Context) bool) func(ctx *context.Context)
- type HeaderWare
- func (this *HeaderWare) FilterWrapper(fn func(ctx *context.Context) bool, next func(ctx *context.Context) bool) func(ctx *context.Context) bool
- func (this *HeaderWare) GetHandler() beego.FilterFunc
- func (this *HeaderWare) Init()
- func (this *HeaderWare) Middleware() string
- func (this *HeaderWare) Register(args ...interface{})
- func (this *HeaderWare) SetHandler(handlers ...func(ctx *context.Context) bool) Middleware
- func (this *HeaderWare) Wrapper(fn func(ctx *context.Context) bool, next func(ctx *context.Context) bool) func(ctx *context.Context)
- type Initialization
- type Middleware
Constants ¶
View Source
const ( Auth = "auth" AuthMiddlewareName = "api.auth" )
View Source
const ( Header = "header" HeaderMiddleWareName = "api.header" RequestId = "ApiRequestId" )
View Source
const ( Cors = "cors" CorsMiddlewareName = "api.cors" )
View Source
const ( AttachTicket = "ticket" AttachTicketMiddlewareName = "attach.ticket" TicketOk = "_ticketPass" LoginOk = "_loginPass" )
View Source
const ( AuthUser = "user" AuthUserId = "userId" TokenMiddleware = "token" AppAccessTokenHeader = "authorization" AppAccessMacHeader = "visitor" )
View Source
const (
MiddlewareManger = "manager"
)
View Source
const (
RoleMiddleware = "role"
)
Variables ¶
This section is empty.
Functions ¶
func AuthorizationParse ¶
func GetMiddlewareManger ¶
func GetMiddlewareManger() *middlewareManager
func GetRoleMiddleware ¶
func GetRoleMiddleware() *roleMiddleware
func GetTokenMiddleware ¶
func GetTokenMiddleware() *tokenMiddleware
func Register ¶
func Register(name string, mid Middleware) *middlewareManager
Types ¶
type AttachTicketMiddleware ¶
type AttachTicketMiddleware struct {
// contains filtered or unexported fields
}
func GetAttachTicketMiddleware ¶
func GetAttachTicketMiddleware() *AttachTicketMiddleware
GetAttachTicketMiddleware 获取附件防盗链中间键
func (*AttachTicketMiddleware) FilterWrapper ¶
func (*AttachTicketMiddleware) GetHandler ¶
func (this *AttachTicketMiddleware) GetHandler() beego.FilterFunc
func (*AttachTicketMiddleware) Init ¶
func (this *AttachTicketMiddleware) Init()
func (*AttachTicketMiddleware) Middleware ¶
func (this *AttachTicketMiddleware) Middleware() string
func (*AttachTicketMiddleware) Register ¶
func (this *AttachTicketMiddleware) Register(args ...interface{})
func (*AttachTicketMiddleware) SetHandler ¶
func (this *AttachTicketMiddleware) SetHandler(handlers ...func(ctx *context.Context) bool) Middleware
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
func GetAuthMiddleware ¶
func GetAuthMiddleware() *AuthMiddleware
func (*AuthMiddleware) Init ¶
func (this *AuthMiddleware) Init()
type CorsMiddleware ¶
type CorsMiddleware struct {
// contains filtered or unexported fields
}
func (*CorsMiddleware) FilterWrapper ¶
func (*CorsMiddleware) GetHandler ¶
func (this *CorsMiddleware) GetHandler() beego.FilterFunc
func (*CorsMiddleware) Init ¶
func (this *CorsMiddleware) Init()
func (*CorsMiddleware) Middleware ¶
func (this *CorsMiddleware) Middleware() string
func (*CorsMiddleware) SetHandler ¶
func (this *CorsMiddleware) SetHandler(handlers ...func(ctx *context.Context) bool) Middleware
type HeaderWare ¶
type HeaderWare struct {
// contains filtered or unexported fields
}
请求 头部参数处理中间件
func GetHeaderWares ¶
func GetHeaderWares() *HeaderWare
func (*HeaderWare) FilterWrapper ¶
func (*HeaderWare) GetHandler ¶
func (this *HeaderWare) GetHandler() beego.FilterFunc
func (*HeaderWare) Init ¶
func (this *HeaderWare) Init()
func (*HeaderWare) Middleware ¶
func (this *HeaderWare) Middleware() string
func (*HeaderWare) SetHandler ¶
func (this *HeaderWare) SetHandler(handlers ...func(ctx *context.Context) bool) Middleware
type Initialization ¶
type Initialization interface {
Init()
}
type Middleware ¶
type Middleware interface { Register(args ...interface{}) GetHandler() beego.FilterFunc Middleware() string }
func GetMiddleware ¶
func GetMiddleware(name string) Middleware
Click to show internal directories.
Click to hide internal directories.