Documentation
¶
Index ¶
Constants ¶
View Source
const ( PenddingMinute = 24 * 60 //閒置自動登出時間,單位分鐘 AuthTokenKey = "Auth-Token" RemoteTokenKey = "Remote-Token" )
View Source
const (
BearerAuthTokenKey = "Authorization"
)
Variables ¶
This section is empty.
Functions ¶
func BuildChain ¶
func BuildChain(f http.HandlerFunc, m ...Middleware) http.HandlerFunc
buildChain builds the middlware chain recursively, functions are first class
Types ¶
type AuthMidInter ¶
type AuthMidInter interface { Middle AddAuthPath(path string, method string, isAuth bool, group []auth.UserPerm) }
func NewAuthMid ¶
func NewAuthMid(token auth.JwtToken, kid string) AuthMidInter
func NewBearerAuthMid ¶ added in v0.15.0
func NewBearerAuthMid(tokenParser AuthTokenParser) AuthMidInter
type AuthTokenParser ¶ added in v0.15.0
type AuthTokenParser interface {
Parser(token string) (TokenParserResult, error)
}
type Middle ¶
type Middle interface { GetName() string GetMiddleWare() func(f http.HandlerFunc) http.HandlerFunc }
func NewDebugMid ¶
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.