response

package
v0.0.0-...-fe9e2ce Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeOK          = 200
	CodeBadRequest  = -401
	CodeNotFound    = 404
	CodeServerError = 500
)

Variables

This section is empty.

Functions

func BindAs

func BindAs[T any](binder func(any) error) (T, error)

func Error

func Error(c *gin.Context, code int, msg string, data any)

func Success

func Success(c *gin.Context, msg string, data any)

Types

type Body

type Body struct {
	Code    int    `json:"code"`
	Msg     string `json:"msg"`
	Data    any    `json:"data,omitempty"`
	TraceID string `json:"trace_id,omitempty"`
}

Source Files

  • response.go

Jump to

Keyboard shortcuts

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