response

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithResponseMiddleware

func WithResponseMiddleware(f HandleFunc) gin.HandlerFunc

func WriteError

func WriteError(ctx *gin.Context, err error)

func WriteSuccess

func WriteSuccess(ctx *gin.Context, data any, statusCode ...int)

Types

type HandleFunc

type HandleFunc func(ctx *gin.Context) (interface{}, error)

type Response

type Response struct {
	Message *string `json:"message,omitempty"`
	Error   *string `json:"error,omitempty"`
	Data    any     `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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