response

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode = 0
	FailedCode  = 500
)

Variables

View Source
var (
	MsgMap = map[int]string{
		SuccessCode: "success",
		FailedCode:  "failed",
	}
)

Functions

func Failed

func Failed(c *gin.Context, msg string, err error)

func Success

func Success(c *gin.Context, msg string, data interface{})

Types

type Interface

type Interface interface {
	Success(c *gin.Context, msg string, data interface{})
	Failed(c *gin.Context, msg string, err error)
}

func NewDefault

func NewDefault() Interface

Jump to

Keyboard shortcuts

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