njs_router

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 AuthForbidden(c *gin.Context, err error)

func AuthRequire

func AuthRequire(c *gin.Context, err error)

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 AuthCode

type AuthCode uint8

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL