ginwrapper

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteResponse

func WriteResponse(c *gin.Context, err error, data interface{})

WriteResponse write an error or the response data into http response body. The Response.Error is empty if the err is null, or the Response.Error is the error message.

Types

type Response

type Response struct {
	// Message is the detail message of the error
	Error string `json:"error"`
	// Data is the response data
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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