ginutil

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResponseHandler func(c *Context, data interface{}, err error)

自定义响应处理函数

Functions

func Default

func Default() *gin.Engine

func New

func New() *gin.Engine

func ResponseError

func ResponseError(c *Context, err error)

响应失败结果

func ResponseOk

func ResponseOk(c *Context, data interface{})

响应成功结果

func ServiceHandler

func ServiceHandler(parseParams func(c *Context) []interface{}, serviceHandler func(args ...interface{}) (result interface{}, err error)) func(c *Context)

抽象服务处理接口

Types

type Arg

type Arg = interface{}

type Context

type Context = gin.Context

type Engine

type Engine = gin.Engine

type H

type H = gin.H

type ResponseData

type ResponseData struct {
	OK    bool        `json:"ok"`
	Error string      `json:"error,omitempty"`
	Data  interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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