Documentation
¶
Overview ¶
gin's wrapper
Index ¶
- func FindAction(c *gin.Context) *tingyun.Action
- type WrapEngine
- func (e *WrapEngine) Delims(left, right string) *WrapEngine
- func (e *WrapEngine) HandleContext(c *gin.Context)
- func (e *WrapEngine) LoadHTMLFiles(files ...string)
- func (e *WrapEngine) LoadHTMLGlob(pattern string)
- func (e *WrapEngine) NoMethod(handlers ...gin.HandlerFunc)
- func (e *WrapEngine) NoRoute(handlers ...gin.HandlerFunc)
- func (e *WrapEngine) Routes() gin.RoutesInfo
- func (e *WrapEngine) Run(addr ...string) error
- func (e *WrapEngine) RunTLS(addr string, certFile string, keyFile string) error
- func (e *WrapEngine) RunUnix(file string) error
- func (e *WrapEngine) SecureJsonPrefix(prefix string) *WrapEngine
- func (e *WrapEngine) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (e *WrapEngine) SetFuncMap(funcMap template.FuncMap)
- func (e *WrapEngine) SetHTMLTemplate(templ *template.Template)
- func (e *WrapEngine) TingYunGinEngine() *gin.Engine
- func (e *WrapEngine) Use(middleware ...gin.HandlerFunc) gin.IRoutes
- type WrapGroup
- func (g *WrapGroup) Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) BasePath() string
- func (g *WrapGroup) DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) Group(relativePath string, handlers ...gin.HandlerFunc) *WrapGroup
- func (g *WrapGroup) HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) Handle(httpMethod, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func (g *WrapGroup) Static(relativePath, root string) gin.IRoutes
- func (g *WrapGroup) StaticFS(relativePath string, fs http.FileSystem) gin.IRoutes
- func (g *WrapGroup) StaticFile(relativePath, filepath string) gin.IRoutes
- func (g *WrapGroup) TingYunGinRouterGroup() *gin.RouterGroup
- func (g *WrapGroup) Use(middleware ...gin.HandlerFunc) gin.IRoutes
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAction ¶
通过一个wrap过的gin.Context 获取这个Context对应的Action
Types ¶
type WrapEngine ¶
type WrapEngine struct {
WrapGroup
// contains filtered or unexported fields
}
Wrap gin.Engine
func Default ¶
func Default() *WrapEngine
Example ¶
tingyun.AppInit("tingyun.json") //初始化tingyun探针
defer tingyun.AppStop() //退出时关闭探针
r := tingyun_gin.Default() //这里替换掉原来的gin.Default
r.GET("/ping", func(c *gin.Context) {
component := tingyun_gin.FindAction(c).CreateComponent("gin.Context::JSON")
c.JSON(200, gin.H{
"message": "pong",
})
component.Finish()
})
r.Run(":8000")
func New ¶
func New() *WrapEngine
Example ¶
tingyun.AppInit("tingyun.json") //初始化tingyun探针
defer tingyun.AppStop() //退出时关闭探针
r := tingyun_gin.New() //这里替换掉原来的gin.New
r.GET("/ping", func(c *gin.Context) {
component := tingyun_gin.FindAction(c).CreateComponent("gin.Context::JSON")
c.JSON(200, gin.H{
"message": "pong",
})
component.Finish()
})
r.Run(":8000")
func (*WrapEngine) Delims ¶
func (e *WrapEngine) Delims(left, right string) *WrapEngine
///////////////////////////////////////////////////////////////////////////
func (*WrapEngine) HandleContext ¶
func (e *WrapEngine) HandleContext(c *gin.Context)
func (*WrapEngine) LoadHTMLFiles ¶
func (e *WrapEngine) LoadHTMLFiles(files ...string)
func (*WrapEngine) LoadHTMLGlob ¶
func (e *WrapEngine) LoadHTMLGlob(pattern string)
func (*WrapEngine) NoMethod ¶
func (e *WrapEngine) NoMethod(handlers ...gin.HandlerFunc)
func (*WrapEngine) NoRoute ¶
func (e *WrapEngine) NoRoute(handlers ...gin.HandlerFunc)
func (*WrapEngine) Routes ¶
func (e *WrapEngine) Routes() gin.RoutesInfo
func (*WrapEngine) Run ¶
func (e *WrapEngine) Run(addr ...string) error
func (*WrapEngine) RunTLS ¶
func (e *WrapEngine) RunTLS(addr string, certFile string, keyFile string) error
func (*WrapEngine) RunUnix ¶
func (e *WrapEngine) RunUnix(file string) error
func (*WrapEngine) SecureJsonPrefix ¶
func (e *WrapEngine) SecureJsonPrefix(prefix string) *WrapEngine
func (*WrapEngine) ServeHTTP ¶
func (e *WrapEngine) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*WrapEngine) SetFuncMap ¶
func (e *WrapEngine) SetFuncMap(funcMap template.FuncMap)
func (*WrapEngine) SetHTMLTemplate ¶
func (e *WrapEngine) SetHTMLTemplate(templ *template.Template)
func (*WrapEngine) TingYunGinEngine ¶
func (e *WrapEngine) TingYunGinEngine() *gin.Engine
func (*WrapEngine) Use ¶
func (e *WrapEngine) Use(middleware ...gin.HandlerFunc) gin.IRoutes
type WrapGroup ¶
type WrapGroup struct {
// contains filtered or unexported fields
}
Wrap gin.RouterGroup
func (*WrapGroup) Group ¶
func (g *WrapGroup) Group(relativePath string, handlers ...gin.HandlerFunc) *WrapGroup
func (*WrapGroup) StaticFile ¶
func (*WrapGroup) TingYunGinRouterGroup ¶
func (g *WrapGroup) TingYunGinRouterGroup() *gin.RouterGroup
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
server_a
command
|
|
|
server_b
command
|
|
|
server_c
command
|
|
|
server_d
command
|
|
|
server_e
command
|
|
|
server_f
command
|
|
|
server_g
command
|
|
|
server_h
command
|
|
|
server_i
command
|
|
|
server_j
command
|
|
|
server_k
command
|
|
|
server_l
command
|
|
|
server_m
command
|
|
|
server_n
command
|
|
|
server_o
command
|
|
|
server_p
command
|
|
|
server_q
command
|
|
|
server_r
command
|
|
|
server_s
command
|
|
|
server_s/assets
command
|
|
|
server_t
command
|
|
|
server_u
command
|
|
|
server_v
command
|
|
|
server_w
command
|
|
|
server_x
command
|
|
|
server_y
command
|
|
|
server_z
command
|
|
|
server_za
command
|
Click to show internal directories.
Click to hide internal directories.