response

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ERROR Default error code returned
	ERROR = 422
	//SUCCESS Default success code return
	SUCCESS = 200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	Total int64       `json:"total"` //Total total pages
	List  interface{} `json:"list"`  //List json data
}

Page Pagination return

type Write

type Write struct {
	StatusCode int         `json:"statusCode"` //Error Code
	Msg        string      `json:"msg"`        //Msg Prompt message
	Result     interface{} `json:"result"`     //Data
	Error      interface{} `json:"error"`      //Error message
}

Write Return parameter

func ErrorResponse

func ErrorResponse(err string) *Write

ErrorResponse Error output

func Fail

func Fail(msg string, err ...string) *Write

Fail Error return, the second parameter is passed back to the front end and printed

func Success

func Success(msg string, data ...interface{}) *Write

Success Successfully returned

Jump to

Keyboard shortcuts

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