Documentation ¶
Index ¶
Constants ¶
View Source
const ( PenddingMinute = 24 * 60 //閒置自動登出時間,單位分鐘 AuthTokenKey = "Auth-Token" RemoteTokenKey = "Remote-Token" )
View Source
const (
BearerAuthTokenKey = "Authorization"
)
View Source
const (
CtxServDiKey = util.CtxKey("ServiceDI")
)
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 AuthGinMidInter ¶ added in v1.0.0
type AuthGinMidInter interface { GinMiddle AddAuthPath(path string, method string, isAuth bool, group []auth.UserPerm) }
func NewGinBearAuthMid ¶ added in v1.1.0
func NewGinBearAuthMid(service string, isMatchHost bool) AuthGinMidInter
func NewMockAuthMid ¶ added in v1.0.0
func NewMockAuthMid() AuthGinMidInter
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, isMatchHost bool) AuthMidInter
func NewInterAuthMid ¶ added in v0.19.0
func NewInterAuthMid(url string) AuthMidInter
type AuthTokenParser ¶ added in v0.15.0
type AuthTokenParser func(token string) (TokenParserResult, error)
type DevDIMiddle ¶ added in v1.1.0
type DevDIMiddle string
type GinMiddle ¶ added in v1.0.0
type GinMiddle interface { GetName() string Handler() gin.HandlerFunc }
func NewGinDBMid ¶ added in v1.1.0
func NewGinDebugMid ¶ added in v1.1.1
func NewGinFixDiMid ¶ added in v1.1.0
func NewGinTokenParserMid ¶ added in v1.2.5
func NewGinTokenParserMid(service string, parser AuthTokenParser) GinMiddle
type Middle ¶
type Middle interface { GetName() string GetMiddleWare() func(f http.HandlerFunc) http.HandlerFunc }
func NewDebugMid ¶
func NewServiceMid ¶ added in v0.18.0
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.