response

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MulanPSL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CodeMsgMap = map[int]string{}
	ShowMore   = true
)

Functions

func SetCode added in v0.1.2

func SetCode(v *int, code int)

func SetData added in v0.1.2

func SetData(v *interface{}, data interface{})

func SetErrCode added in v0.1.2

func SetErrCode(c *int, m *string, code int)

func SetError added in v0.1.2

func SetError(c *[]string, errs ...error)

func SetMeta added in v0.1.2

func SetMeta(v *interface{}, meta interface{})

func SetMsg added in v0.1.2

func SetMsg(v *string, msg string, msgArgs ...interface{})

Types

type Response

type Response interface {
	SetErrCode(int) Response
	SetErrMsg(int, string, ...interface{}) Response
	SetData(interface{}) Response
	SetDataMsg(interface{}, string, ...interface{}) Response
	SetMeta(interface{}) Response
	AddError(...error) Response
}

func New

func New() Response

Jump to

Keyboard shortcuts

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