Documentation
¶
Index ¶
- Variables
- func AddGuard(name string, guard gin.HandlerFunc)
- func IsAllowed(c *gin.Context, allowsMap map[string]bool) bool
- func ProcessGuard(name string) gin.HandlerFunc
- func SetGuards(guards map[string]gin.HandlerFunc)
- func SetRoutes(router *gin.Engine, path string, allows ...string)
- type API
- type HTTP
- type Out
- type Path
- type Redirect
Constants ¶
This section is empty.
Variables ¶
View Source
var APIs = map[string]*API{}
APIs 已加载API列表
View Source
var HTTPGuards = map[string]gin.HandlerFunc{}
HTTPGuards 支持的中间件
Functions ¶
Types ¶
type HTTP ¶
type HTTP struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
Group string `json:"group,omitempty"`
Guard string `json:"guard,omitempty"`
Paths []Path `json:"paths,omitempty"`
}
HTTP http 协议服务
type Out ¶
type Out struct {
Status int `json:"status"`
Type string `json:"type,omitempty"`
Body interface{} `json:"body,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Redirect *Redirect `json:"redirect,omitempty"`
}
Out http 输出
type Path ¶
type Path struct {
Label string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
Path string `json:"path"`
Method string `json:"method"`
Process string `json:"process"`
Guard string `json:"guard,omitempty"`
In []interface{} `json:"in,omitempty"`
Out Out `json:"out,omitempty"`
}
Path HTTP Path
Click to show internal directories.
Click to hide internal directories.