response

package
v0.2.4-beta Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BusinessError

func BusinessError(message any, code ...int) error

func BusinessLangError

func BusinessLangError(ctx echo.Context, message string, code ...int) error

func GetEchoCtx

func GetEchoCtx(ctx context.Context) echo.Context

func Render

func Render(ctx echo.Context, app string, name string, bind any, code ...int) error

func Send

func Send(ctx echo.Context, data Data, code ...int) error

func ValidatorError

func ValidatorError(message string, data any, code ...int) error

Types

type Data

type Data struct {
	Code        int    `json:"code" example:"200"`
	Message     string `json:"message" example:"ok"`
	MessageLang string `json:"-"`
	Data        any    `json:"data"`
	Meta        any    `json:"meta"`
}

type ValidatorData

type ValidatorData Data

func (*ValidatorData) Error

func (t *ValidatorData) Error() string

Jump to

Keyboard shortcuts

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