Back to godoc.org

Package output

v0.3.0
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/douyu/juno

Index

Constants

const (
	MsgOk             = 0
	MsgRedirect       = 302
	MsgErr            = 1
	MsgNoAuth         = 14000
	MsgOpenAuthFailed = 14001
	MsgNeedLogin      = 10000
)

func JSON

func JSON(c echo.Context, Code int, message string, data ...interface{}) error

JSON 渲染

type JSONResult

type JSONResult struct {
	Code    int         `json:"code"`
	Message string      `json:"msg"`
	Data    interface{} `json:"data"`
}

JSONResult json

func WithData

func WithData(data interface{}) JSONResult

type Pagination

type Pagination struct {
	Total       int `json:"total"`
	CurrentPage int `json:"current_page"` // current page
}

Pagination

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier