response

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error added in v0.2.0

func Error(c echo.Context, message string) error

Error renders an error page with the given message

func ErrorResponse added in v0.1.5

func ErrorResponse(c echo.Context, statusCode int, message string) error

ErrorResponse sends an error response with a custom status code

func NotFound

func NotFound(c echo.Context) error

NotFound renders a 404 error page

func ServerError added in v0.2.0

func ServerError(c echo.Context) error

ServerError renders a 500 error page

func Success

func Success(c echo.Context, data any) error

Success sends a successful response with the given data

func WebErrorResponse added in v0.2.0

func WebErrorResponse(c echo.Context, renderer view.Renderer, statusCode int, message string) error

WebErrorResponse renders an error page for web handlers

Types

type APIResponse added in v0.1.5

type APIResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
	Data    any    `json:"data,omitempty"`
}

APIResponse represents a standardized API response structure

Jump to

Keyboard shortcuts

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