response

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsError

func IsError(code int) bool

func JSON

func JSON(w http.ResponseWriter, v interface{}, code int) error

func ListJSON

func ListJSON(w http.ResponseWriter, v interface{}, info *PageInfo, code int) error

Types

type Body

type Body map[string]interface{}

func Error

func Error(err error) Body

type PageInfo

type PageInfo struct {
	TotalCount int64 `json:"totalCount"`
	Page       int64 `json:"page"`
	PageSize   int64 `json:"pageSize"`
}

Jump to

Keyboard shortcuts

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