rest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortResponse

func AbortResponse(ctx *gin.Context, statusCode int, succeed bool, message string, results any, metas any)

func BadRequestResponse

func BadRequestResponse(ctx *gin.Context, error string, data any)

func FailedResponse

func FailedResponse(ctx *gin.Context, status int, error string)

func GeneralResponse

func GeneralResponse(ctx *gin.Context, statusCode int, succeed bool, message string, results any, metas any)

func NotFoundResponse

func NotFoundResponse(ctx *gin.Context, error string)

func OKResponse

func OKResponse(ctx *gin.Context)

func SuccessCreateResponse

func SuccessCreateResponse(ctx *gin.Context)

func SuccessResponse

func SuccessResponse(ctx *gin.Context, message string, results any)

func SuccessResponseWithMeta

func SuccessResponseWithMeta(ctx *gin.Context, message string, results, metas any)

func UnauthorizedResponse

func UnauthorizedResponse(ctx *gin.Context, statusCode int, error string)

Types

type Response

type Response struct {
	Succeed bool   `json:"succeed"`
	Message string `json:"message"`
	Results any    `json:"results"`
	Metas   any    `json:"metas"`
}

Jump to

Keyboard shortcuts

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