apiresp

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinError

func GinError(c *gin.Context, err error)

func GinSuccess

func GinSuccess(c *gin.Context, data any)

func HttpError

func HttpError(w http.ResponseWriter, err error)

func HttpSuccess

func HttpSuccess(w http.ResponseWriter, data any)

Types

type ApiFormat

type ApiFormat interface {
	ApiFormat()
}

type ApiResponse

type ApiResponse struct {
	ErrCode int    `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
	ErrDlt  string `json:"errDlt"`
	Data    any    `json:"data,omitempty"`
}

func ApiSuccess

func ApiSuccess(data any) *ApiResponse

func ParseError

func ParseError(err error) *ApiResponse

Jump to

Keyboard shortcuts

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