Versions in this module Expand all Collapse all v1 v1.0.9 Jan 9, 2025 Changes in this version + func GetLoginUID(token string, tokenPrefix string, cache cache.Cache) string + type Context struct + func (c *Context) CheckLoginRole() error + func (c *Context) CheckLoginRoleIsSuperAdmin() 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 func(c *Context) + func CORSMiddleware() HandlerFunc + type RouterGroup struct + L *WKHttp + func (r *RouterGroup) DELETE(relativePath string, handlers ...HandlerFunc) + func (r *RouterGroup) GET(relativePath string, handlers ...HandlerFunc) + func (r *RouterGroup) POST(relativePath string, handlers ...HandlerFunc) + func (r *RouterGroup) PUT(relativePath string, handlers ...HandlerFunc) + type UserRole string + const Admin + const SuperAdmin + type WKHttp struct + func New() *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