Documentation
¶
Index ¶
- Constants
- func AuthForbidden(c *gin.Context, err error)
- func AuthRequire(c *gin.Context, err error)
- func Handler(routerList RouterList) http.Handler
- func RoutersHandler(...)
- func RoutersRegister(method string, relativePath string, router ...gin.HandlerFunc)
- func SetGinHnadler(fct func(c *gin.Context)) gin.HandlerFunc
- type AuthCode
- type Authorization
- type Headers
- type RegisterRouter
- type RouterList
Constants ¶
View Source
const ( AUTH_CODE_SUCCESS = iota AUTH_CODE_REQUIRE AUTH_CODE_FORBIDDEN )
View Source
const ( HEAD_AUTH_REQR = "WWW-Authenticate" HEAD_AUTH_SEND = "Authorization" HEAD_AUTH_REAL = "Basic realm=LDAP Authorization Required" )
Variables ¶
This section is empty.
Functions ¶
func AuthForbidden ¶
func AuthRequire ¶
func Handler ¶
func Handler(routerList RouterList) http.Handler
func RoutersHandler ¶
func RoutersHandler(handle func(httpMethod, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes)
func RoutersRegister ¶
func RoutersRegister(method string, relativePath string, router ...gin.HandlerFunc)
func SetGinHnadler ¶
func SetGinHnadler(fct func(c *gin.Context)) gin.HandlerFunc
Types ¶
type Authorization ¶
type Authorization interface { Handler(c *gin.Context) Register(router ...gin.HandlerFunc) gin.HandlerFunc Append(router ...gin.HandlerFunc) }
func NewAuthorization ¶
func NewAuthorization(HeadAuthType string, authCheckFunc func(AuthHeader string) (AuthCode, error)) Authorization
type Headers ¶
type Headers interface { Add(key, value string) Set(key, value string) Get(key string) string Del(key string) Header() map[string]string Register(router ...gin.HandlerFunc) []gin.HandlerFunc Handler(c *gin.Context) Clone() Headers }
func NewHeaders ¶
func NewHeaders() Headers
type RegisterRouter ¶
type RegisterRouter func(method string, relativePath string, router ...gin.HandlerFunc)
type RouterList ¶
type RouterList interface { Register(method string, relativePath string, router ...gin.HandlerFunc) Handler(handle func(httpMethod, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes) }
func NewRouterList ¶
func NewRouterList() RouterList
Click to show internal directories.
Click to hide internal directories.