Documentation
¶
Index ¶
- Constants
- func Convert(handler interface{}) gin.HandlerFunc
- func Error(err error, msg ...string)
- func ErrorHandler() gin.HandlerFunc
- func HandleFairing(responder Responder, ctx *gin.Context) interface{}
- func Throw(err string, code int, context *gin.Context)
- type Fairing
- type FairingHandler
- type Goft
- func (this *Goft) Attach(f ...Fairing) *Goft
- func (this *Goft) Handle(httpMethod, relativePath string, handler interface{}) *Goft
- func (this *Goft) HandleWithFairing(httpMethod, relativePath string, handler interface{}, fairings ...Fairing) *Goft
- func (this *Goft) Launch(port int32)
- func (this *Goft) Mount(group string, classes ...IClass) *Goft
- type GoftTree
- type IClass
- type Json
- type JsonResponder
- type Model
- type Models
- type Param
- type Params
- type Responder
- type RouteInfo
- type RoutesInfo
- type SqlQueryResponder
- type SqlResponder
- type StringResponder
- type TreeNode
- type TreeRouter
- type Viewdeprecated
- type ViewResponder
Constants ¶
View Source
const (
HTTP_STATUS = "GOFT_STATUS"
)
Gin 错误中间件
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert(handler interface{}) gin.HandlerFunc
func ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
func HandleFairing ¶
Deprecated ,please call FairingHandler.handlerFairing
Types ¶
type Fairing ¶
type Fairing interface { OnRequest(*gin.Context) error OnResponse(result interface{}) (interface{}, error) }
中间件 接口
type FairingHandler ¶
type FairingHandler struct {
// contains filtered or unexported fields
}
func NewFairingHandler ¶
func NewFairingHandler() *FairingHandler
func (*FairingHandler) AddFairing ¶
func (this *FairingHandler) AddFairing(f ...Fairing)
type GoftTree ¶
type GoftTree struct {
// contains filtered or unexported fields
}
func NewGoftTree ¶
func NewGoftTree() *GoftTree
type JsonResponder ¶
func (JsonResponder) RespondTo ¶
func (this JsonResponder) RespondTo() gin.HandlerFunc
type Params ¶
type Params []Param
Params is a Param-slice, as returned by the router. The slice is ordered, the first URL parameter is also the first slice value. It is therefore safe to read values by the index.
type Responder ¶
type Responder interface {
RespondTo() gin.HandlerFunc
}
type RoutesInfo ¶
type RoutesInfo []RouteInfo
type SqlQueryResponder ¶
func (SqlQueryResponder) RespondTo ¶
func (this SqlQueryResponder) RespondTo() gin.HandlerFunc
type SqlResponder ¶
type SqlResponder func(*gin.Context) Sql.SimpleQuery
func (SqlResponder) RespondTo ¶
func (this SqlResponder) RespondTo() gin.HandlerFunc
type StringResponder ¶
func (StringResponder) RespondTo ¶
func (this StringResponder) RespondTo() gin.HandlerFunc
type TreeRouter ¶
type TreeRouter struct {
// contains filtered or unexported fields
}
func NewTreeRouter ¶
func NewTreeRouter() *TreeRouter
type ViewResponder ¶
func (ViewResponder) RespondTo ¶
func (this ViewResponder) RespondTo() gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.