gin

package
v0.0.0-...-28c4e55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapControllerFunction

func WrapControllerFunction(ctlFunc func(ctx *WrapContext)) ggin.HandlerFunc

WrapControllerFunction wrap gin.Contenxt and local model.Context

Types

type Result

type Result map[string]interface{}

Result 返回

type Verifier

type Verifier interface {
	// Validation 验证
	Validation(obj interface{}) error
}

Verifier 验证人

type WrapContext

type WrapContext struct {
	*ggin.Context
}

WrapContext include gin context and local context

func (*WrapContext) BindValidation

func (w *WrapContext) BindValidation(v Verifier, obj interface{}) bool

BindValidation 绑定验证

func (*WrapContext) ErrorJSON

func (w *WrapContext) ErrorJSON(err error)

ErrorJSON 返回状态等于400的Error

func (*WrapContext) OKJSON

func (w *WrapContext) OKJSON(obj interface{})

OKJSON 返回状态等于200的JSON

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL