Documentation
¶
Index ¶
- func GetLoginUID(token string, tokenPrefix string, cache cache.Cache) string
- type Context
- func (c *Context) CheckLoginRole() error
- func (c *Context) GetAppID() string
- func (c *Context) GetLoginName() string
- func (c *Context) GetLoginRole() string
- func (c *Context) GetLoginUID() string
- func (c *Context) GetPage() (pageIndex int64, pageSize int64)
- func (c *Context) ResponseError(err error)
- func (c *Context) ResponseErrorWithStatus(err error, status int)
- func (c *Context) ResponseErrorf(msg string, err error)
- func (c *Context) ResponseOK()
- func (c *Context) ResponseWithStatus(status int, data interface{})
- type HandlerFunc
- type IMHttp
- func (imHttp *IMHttp) Any(relativePath string, handlers ...HandlerFunc)
- func (imHttp *IMHttp) AuthMiddleware(cache cache.Cache, tokenPrefix string) HandlerFunc
- func (imHttp *IMHttp) GET(relativePath string, handlers ...HandlerFunc)
- func (imHttp *IMHttp) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
- func (imHttp *IMHttp) HandleContext(c *Context)
- func (imHttp *IMHttp) IMHttpHandler(handlerFunc HandlerFunc) gin.HandlerFunc
- func (imHttp *IMHttp) LoadHTMLGlob(pattern string)
- func (imHttp *IMHttp) POST(relativePath string, handlers ...HandlerFunc)
- func (imHttp *IMHttp) Run(addr ...string) error
- func (imHttp *IMHttp) RunTLS(addr, certFile, keyFile string) error
- func (imHttp *IMHttp) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (imHttp *IMHttp) Static(relativePath string, root string)
- func (imHttp *IMHttp) Use(handlers ...HandlerFunc)
- func (imHttp *IMHttp) UseGin(handlers ...gin.HandlerFunc)
- type RouterGroup
- type UserRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
func (*Context) CheckLoginRole ¶
func (*Context) GetLoginName ¶
func (*Context) GetLoginRole ¶
func (*Context) GetLoginUID ¶
func (*Context) ResponseError ¶
func (*Context) ResponseErrorWithStatus ¶
func (*Context) ResponseErrorf ¶
func (*Context) ResponseOK ¶
func (c *Context) ResponseOK()
func (*Context) ResponseWithStatus ¶
type HandlerFunc ¶
type HandlerFunc func(c *Context)
type IMHttp ¶
type IMHttp struct {
// contains filtered or unexported fields
}
func (*IMHttp) Any ¶
func (imHttp *IMHttp) Any(relativePath string, handlers ...HandlerFunc)
func (*IMHttp) AuthMiddleware ¶
func (imHttp *IMHttp) AuthMiddleware(cache cache.Cache, tokenPrefix string) HandlerFunc
AuthMiddleware 认证中间件
func (*IMHttp) GET ¶
func (imHttp *IMHttp) GET(relativePath string, handlers ...HandlerFunc)
func (*IMHttp) Group ¶
func (imHttp *IMHttp) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
Group Group
func (*IMHttp) HandleContext ¶
HandleContext HandleContext
func (*IMHttp) IMHttpHandler ¶
func (imHttp *IMHttp) IMHttpHandler(handlerFunc HandlerFunc) gin.HandlerFunc
func (*IMHttp) LoadHTMLGlob ¶
LoadHTMLGlob LoadHTMLGlob
func (*IMHttp) POST ¶
func (imHttp *IMHttp) POST(relativePath string, handlers ...HandlerFunc)
type RouterGroup ¶
type RouterGroup struct { *gin.RouterGroup L *IMHttp }
RouterGroup RouterGroup
func (*RouterGroup) DELETE ¶
func (r *RouterGroup) DELETE(relativePath string, handlers ...HandlerFunc)
DELETE DELETE
func (*RouterGroup) GET ¶
func (r *RouterGroup) GET(relativePath string, handlers ...HandlerFunc)
GET GET
func (*RouterGroup) POST ¶
func (r *RouterGroup) POST(relativePath string, handlers ...HandlerFunc)
POST POST
func (*RouterGroup) PUT ¶
func (r *RouterGroup) PUT(relativePath string, handlers ...HandlerFunc)
PUT PUT
Click to show internal directories.
Click to hide internal directories.