Documentation ¶ Index ¶ Variables func Cors() gin.HandlerFunc type Context type Ctx func (receiver Ctx) Fail(err error) func (receiver Ctx) Gin() *gin.Context func (receiver Ctx) Id() uint64 func (receiver Ctx) Success(data interface{}) func (receiver Ctx) Token() string func (receiver Ctx) User() interface{} Constants ¶ This section is empty. Variables ¶ View Source var NewContext = func(ctx *gin.Context) Context { return &Ctx{ Context: ctx, } } Functions ¶ func Cors ¶ func Cors() gin.HandlerFunc Cors 跨域 Types ¶ type Context ¶ type Context interface { Success(data interface{}) Fail(err error) Gin() *gin.Context Token() string Id() uint64 } type Ctx ¶ type Ctx struct { *gin.Context } func (Ctx) Fail ¶ func (receiver Ctx) Fail(err error) func (Ctx) Gin ¶ func (receiver Ctx) Gin() *gin.Context func (Ctx) Id ¶ func (receiver Ctx) Id() uint64 func (Ctx) Success ¶ func (receiver Ctx) Success(data interface{}) func (Ctx) Token ¶ func (receiver Ctx) Token() string func (Ctx) User ¶ func (receiver Ctx) User() interface{} Source Files ¶ View all Source files context.go middleware.go Click to show internal directories. Click to hide internal directories.