response

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c *fiber.Ctx, message string) error

BadRequest sends a 400 Bad Request response

func Error

func Error(c *fiber.Ctx, status int, message string) error

Error sends an error response

func InternalError

func InternalError(c *fiber.Ctx, message string) error

InternalError sends a 500 Internal Server Error response

func NotFound

func NotFound(c *fiber.Ctx, message string) error

NotFound sends a 404 Not Found response

func Success

func Success(c *fiber.Ctx, data interface{}) error

Success sends a successful response

Types

type Response

type Response struct {
	Success bool        `json:"success"`
	Data    interface{} `json:"data,omitempty"`
	Error   string      `json:"error,omitempty"`
}

Response is the standard API response format

Jump to

Keyboard shortcuts

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