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) GetSpanContext() opentracing.SpanContext
- func (c *Context) Response(data interface{})
- 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 RouterGroup
- type UserRole
- type WKHttp
- func (l *WKHttp) Any(relativePath string, handlers ...HandlerFunc)
- func (l *WKHttp) AuthMiddleware(cache cache.Cache, tokenPrefix string) HandlerFunc
- func (l *WKHttp) GET(relativePath string, handlers ...HandlerFunc)
- func (l *WKHttp) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
- func (l *WKHttp) HandleContext(c *Context)
- func (l *WKHttp) LoadHTMLGlob(pattern string)
- func (l *WKHttp) POST(relativePath string, handlers ...HandlerFunc)
- func (l *WKHttp) Run(addr ...string) error
- func (l *WKHttp) RunTLS(addr, certFile, keyFile string) error
- func (l *WKHttp) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (l *WKHttp) Static(relativePath string, root string)
- func (l *WKHttp) Use(handlers ...HandlerFunc)
- func (l *WKHttp) UseGin(handlers ...gin.HandlerFunc)
- func (l *WKHttp) WKHttpHandler(handlerFunc HandlerFunc) gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
Context Context
func (*Context) GetSpanContext ¶
func (c *Context) GetSpanContext() opentracing.SpanContext
GetSpanContext 获取当前请求的span context
func (*Context) ResponseError ¶
ResponseError ResponseError
func (*Context) ResponseErrorWithStatus ¶
ResponseErrorWithStatus ResponseErrorWithStatus
func (*Context) ResponseErrorf ¶
ResponseErrorf ResponseErrorf
func (*Context) ResponseWithStatus ¶
ResponseWithStatus ResponseWithStatus
type RouterGroup ¶
type RouterGroup struct { *gin.RouterGroup L *WKHttp }
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
type WKHttp ¶
type WKHttp struct {
// contains filtered or unexported fields
}
WKHttp WKHttp
func (*WKHttp) AuthMiddleware ¶
func (l *WKHttp) AuthMiddleware(cache cache.Cache, tokenPrefix string) HandlerFunc
AuthMiddleware 认证中间件
func (*WKHttp) Group ¶
func (l *WKHttp) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup
Group Group
func (*WKHttp) HandleContext ¶
HandleContext HandleContext
func (*WKHttp) LoadHTMLGlob ¶
LoadHTMLGlob LoadHTMLGlob
func (*WKHttp) ServeHTTP ¶
func (l *WKHttp) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP ServeHTTP
func (*WKHttp) WKHttpHandler ¶
func (l *WKHttp) WKHttpHandler(handlerFunc HandlerFunc) gin.HandlerFunc
WKHttpHandler WKHttpHandler
Click to show internal directories.
Click to hide internal directories.