Documentation ¶
Overview ¶
Package ggin Created by guoxin in 2020/10/25 5:58 下午
Package ggin Created by guoxin in 2020/11/1 4:08 下午
Package ggin Create by guoxin 2021.07.02 ¶
Package ggin Create by guoxin 2021.07.02 ¶
Package ggin Created by guoxin in 2020/10/31 10:01 下午
Package ggin Created by guoxin in 2020/10/31 10:01 下午
Package ggin Created by guoxin in 2020/10/31 10:01 下午
Index ¶
- func Ginzap(logger *zap.Logger, timeFormat string, utc bool) gin.HandlerFunc
- func HandlerNotFound(c *gin.Context)
- func New(params ...interface{})
- func RecoveryWithZap(logger *zap.Logger, stack bool) gin.HandlerFunc
- type Configuration
- type Controller
- type ControllerConfiguration
- type Controllers
- func (c *Controllers) CONNECT(path string, controller Controller)
- func (c *Controllers) DELETE(path string, controller Controller)
- func (c *Controllers) GET(path string, controller Controller)
- func (c *Controllers) HEAD(path string, controller Controller)
- func (c *Controllers) OPTIONS(path string, controller Controller)
- func (c *Controllers) PATCH(path string, controller Controller)
- func (c *Controllers) POST(path string, controller Controller)
- func (c *Controllers) PUT(path string, controller Controller)
- func (c *Controllers) Register(method string, path string, controller Controller)
- func (c *Controllers) TRACE(path string, controller Controller)
- type Parameter
- type Result
- type ResultBuilder
- type ResultMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ginzap ¶
Ginzap returns a gin.HandlerFunc (middleware) that logs requests using uber-go/zap.
Requests with errors are logged using zap.Error(). Requests without errors are logged using zap.Info().
It receives:
- A time package format string (e.g. time.RFC3339).
- A boolean stating whether to use UTC time zone or local.
func HandlerNotFound ¶
func RecoveryWithZap ¶
func RecoveryWithZap(logger *zap.Logger, stack bool) gin.HandlerFunc
RecoveryWithZap returns a gin.HandlerFunc (middleware) that recovers from any panics and logs requests using uber-go/zap. All errors are logged using zap.Error(). stack means whether output the stack info. The stack info is easy to find where the error occurs but the stack info is too large.
Types ¶
type Configuration ¶
type Configuration struct { // Make sure you only initialize it once core.InitializeLock Port string // contains filtered or unexported fields }
func (*Configuration) Initialize ¶
func (c *Configuration) Initialize(params ...interface{}) interface{}
type Controller ¶
Controller Implement Controller coding the interface
type ControllerConfiguration ¶
type ControllerConfiguration interface {
Configure(Controllers)
}
ControllerConfiguration Register the Controller with the gin.RouterGroup route
type Controllers ¶
Controllers Here can use gin.Engine and gin.RouterGroup. gin.RouterGroup.Group() No good ideas yet Controllers are c *gin.Engine wrappers
func (*Controllers) CONNECT ¶
func (c *Controllers) CONNECT(path string, controller Controller)
func (*Controllers) DELETE ¶
func (c *Controllers) DELETE(path string, controller Controller)
func (*Controllers) GET ¶
func (c *Controllers) GET(path string, controller Controller)
func (*Controllers) HEAD ¶
func (c *Controllers) HEAD(path string, controller Controller)
func (*Controllers) OPTIONS ¶
func (c *Controllers) OPTIONS(path string, controller Controller)
func (*Controllers) PATCH ¶
func (c *Controllers) PATCH(path string, controller Controller)
func (*Controllers) POST ¶
func (c *Controllers) POST(path string, controller Controller)
func (*Controllers) PUT ¶
func (c *Controllers) PUT(path string, controller Controller)
func (*Controllers) Register ¶
func (c *Controllers) Register(method string, path string, controller Controller)
func (*Controllers) TRACE ¶
func (c *Controllers) TRACE(path string, controller Controller)
type ResultBuilder ¶
type ResultBuilder interface { }
ResultBuilder request
- query
- body
- path
- header
response
- code
- body
type ResultMessage ¶
ResultMessage 响应码对象