Documentation ¶
Index ¶
- Variables
- func DisableConsoleColor()
- func LoggerWithFormatter(fn func(params LogFormatterParams) string) gin.HandlerFunc
- func SetLogFile(filePath string) error
- func SetMode(value string)
- type Engine
- type GinRouterAdapter
- func (gra *GinRouterAdapter) DELETE(relativePath string, handlers ...HandlerFunc)
- func (gra *GinRouterAdapter) GET(relativePath string, handlers ...HandlerFunc)
- func (gra *GinRouterAdapter) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup
- func (gra *GinRouterAdapter) POST(relativePath string, handlers ...HandlerFunc)
- func (gra *GinRouterAdapter) PUT(relativePath string, handlers ...HandlerFunc)
- func (gra *GinRouterAdapter) Static(relativePath, rootPath string)
- type GinRouterGroupAdapter
- func (grga *GinRouterGroupAdapter) DELETE(relativePath string, handlers ...HandlerFunc)
- func (grga *GinRouterGroupAdapter) GET(relativePath string, handlers ...HandlerFunc)
- func (grga *GinRouterGroupAdapter) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup
- func (grga *GinRouterGroupAdapter) POST(relativePath string, handlers ...HandlerFunc)
- func (grga *GinRouterGroupAdapter) PUT(relativePath string, handlers ...HandlerFunc)
- type HandlerFunc
- type IContext
- type IRouter
- type IRouterGroup
- type LogFormatterParams
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Mode = gin.Mode
)
Functions ¶
func DisableConsoleColor ¶ added in v1.0.5
func DisableConsoleColor()
func LoggerWithFormatter ¶ added in v1.0.5
func LoggerWithFormatter(fn func(params LogFormatterParams) string) gin.HandlerFunc
LoggerWithFormatter 封装 gin.LoggerWithFormatter
func SetLogFile ¶ added in v1.0.8
Types ¶
type Engine ¶
func NewGinEngine ¶
func NewGinEngine() Engine
type GinRouterAdapter ¶
func (*GinRouterAdapter) DELETE ¶
func (gra *GinRouterAdapter) DELETE(relativePath string, handlers ...HandlerFunc)
func (*GinRouterAdapter) GET ¶
func (gra *GinRouterAdapter) GET(relativePath string, handlers ...HandlerFunc)
func (*GinRouterAdapter) Group ¶
func (gra *GinRouterAdapter) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup
func (*GinRouterAdapter) POST ¶
func (gra *GinRouterAdapter) POST(relativePath string, handlers ...HandlerFunc)
func (*GinRouterAdapter) PUT ¶
func (gra *GinRouterAdapter) PUT(relativePath string, handlers ...HandlerFunc)
func (*GinRouterAdapter) Static ¶
func (gra *GinRouterAdapter) Static(relativePath, rootPath string)
type GinRouterGroupAdapter ¶
type GinRouterGroupAdapter struct {
*gin.RouterGroup
}
func (*GinRouterGroupAdapter) DELETE ¶
func (grga *GinRouterGroupAdapter) DELETE(relativePath string, handlers ...HandlerFunc)
func (*GinRouterGroupAdapter) GET ¶
func (grga *GinRouterGroupAdapter) GET(relativePath string, handlers ...HandlerFunc)
func (*GinRouterGroupAdapter) Group ¶
func (grga *GinRouterGroupAdapter) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup
func (*GinRouterGroupAdapter) POST ¶
func (grga *GinRouterGroupAdapter) POST(relativePath string, handlers ...HandlerFunc)
func (*GinRouterGroupAdapter) PUT ¶
func (grga *GinRouterGroupAdapter) PUT(relativePath string, handlers ...HandlerFunc)
type HandlerFunc ¶
type HandlerFunc func(c IContext)
type IContext ¶
type IContext interface { JSON(code int, obj any) Param(key string) string BindJSON(v interface{}) error ShouldBind(v interface{}) error ShouldBindJSON(v interface{}) error ShouldBindQuery(v interface{}) error Get(key string) (value interface{}, exists bool) Set(key string, value interface{}) Next() Request() *http.Request Writer() gin.ResponseWriter FullPath() string GetHeader(key string) string Query(key string) string Abort() Header(key, value string) Data(code int, contentType string, data []byte) String(code int, format string, values ...any) GetInt64(key string) int64 FormFile(formName string) (*multipart.FileHeader, error) SaveUploadedFile(file *multipart.FileHeader, dst string) error }
type IRouter ¶
type IRouter interface { GET(relativePath string, handlers ...HandlerFunc) POST(relativePath string, handlers ...HandlerFunc) PUT(relativePath string, handlers ...HandlerFunc) DELETE(relativePath string, handlers ...HandlerFunc) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup Static(relativePath, rootPath string) }
func NewGinRouterAdapter ¶
type IRouterGroup ¶
type IRouterGroup interface { GET(relativePath string, handlers ...HandlerFunc) POST(relativePath string, handlers ...HandlerFunc) PUT(relativePath string, handlers ...HandlerFunc) DELETE(relativePath string, handlers ...HandlerFunc) Group(relativePath string, handlers ...HandlerFunc) IRouterGroup }
type LogFormatterParams ¶ added in v1.0.5
type LogFormatterParams struct {
gin.LogFormatterParams
}
LogFormatterParams 封装 gin.LogFormatterParams
Click to show internal directories.
Click to hide internal directories.