response

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 9, 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

func SetCode(v *int, code int)

func SetData

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

func SetErrCode

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

func SetError

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

func SetMeta

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

func SetMsg

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