Documentation
¶
Index ¶
- Constants
- func Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func CORSMiddleware() gin.HandlerFunc
- func DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func ErrorLogger() gin.HandlerFunc
- func ErrorLoggerT(typ gin.ErrorType) gin.HandlerFunc
- func GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func GetUserId(c *gin.Context) int64
- func GetUserInfo(c *gin.Context) map[string]interface{}
- func GetUserProp(c *gin.Context, key string) (value interface{}, exists bool)
- func HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func Handle(httpMethod, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func IsSuper(c *gin.Context) bool
- func Logger(duration time.Duration) gin.HandlerFunc
- func OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
- func Run(addr ...string)
- func Static(relativePath, root string) gin.IRoutes
- func StaticFS(relativePath string, fs http.FileSystem) gin.IRoutes
- func StaticFile(relativePath, filepath string) gin.IRoutes
- func TokenErrorAbort(c *gin.Context, code string, message string)
- func TokenMiddleware() gin.HandlerFunc
- func Use(middleware ...gin.HandlerFunc) gin.IRoutes
Constants ¶
const GETUSERINFO string = "TokenUserInfo"
Variables ¶
This section is empty.
Functions ¶
func Any ¶
func Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
Any registers a route that matches all the HTTP methods. GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, CONNECT, TRACE.
func DELETE ¶
func DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
DELETE is a shortcut for router.Handle("DELETE", path, handle).
func ErrorLogger ¶
func ErrorLogger() gin.HandlerFunc
func ErrorLoggerT ¶
func ErrorLoggerT(typ gin.ErrorType) gin.HandlerFunc
func GET ¶
func GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
GET is a shortcut for router.Handle("GET", path, handle).
func GetUserInfo ¶
func HEAD ¶
func HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
HEAD is a shortcut for router.Handle("HEAD", path, handle).
func Handle ¶
func Handle(httpMethod, relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
Handle registers a new request handle and middleware with the given path and method. The last handler should be the real handler, the other ones should be middleware that can and should be shared among different routes. See the example code in github.
For GET, POST, PUT, PATCH and DELETE requests the respective shortcut functions can be used.
This function is intended for bulk loading and to allow the usage of less frequently used, non-standardized or custom methods (e.g. for internal communication with a proxy).
func OPTIONS ¶
func OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
OPTIONS is a shortcut for router.Handle("OPTIONS", path, handle).
func PATCH ¶
func PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
PATCH is a shortcut for router.Handle("PATCH", path, handle).
func POST ¶
func POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
POST is a shortcut for router.Handle("POST", path, handle).
func PUT ¶
func PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes
PUT is a shortcut for router.Handle("PUT", path, handle).
func StaticFile ¶
StaticFile registers a single route in order to serve a single file of the local filesystem. router.StaticFile("favicon.ico", "./resources/favicon.ico")
Types ¶
This section is empty.