response

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c echo.Context, msg string) error

func BadRequestDefaultMessage

func BadRequestDefaultMessage(c echo.Context) error

func BadRequestWithDetails

func BadRequestWithDetails(c echo.Context, msg string, details string) error

func Conflict

func Conflict(c echo.Context, msg string) error

Conflict returns status 409 with a message.

func Created

func Created(c echo.Context, msg string, data interface{}) error

Created returns status 201 with a message and data.

func Forbidden

func Forbidden(c echo.Context, msg string) error

Forbidden returns status 403 with a message.

func InternalError

func InternalError(c echo.Context, msg string) error

InternalError returns status 500 with a message.

func InternalErrorDefaultMsg

func InternalErrorDefaultMsg(c echo.Context) error

func NotFound

func NotFound(c echo.Context, msg string) error

NotFound returns status 404 with a message.

func Ok

func Ok(c echo.Context, data interface{}) error

Ok returns status 200 with data.

func OkWithMsg

func OkWithMsg(c echo.Context, msg string, data interface{}) error

OkWithMsg returns status 200 with a message and data.

func Unauthorized

func Unauthorized(c echo.Context, msg string) error

Unauthorized returns status 401 with a message.

Types

type DataResponse

type DataResponse struct {
	Code         int         `json:"code"`
	Message      string      `json:"message"`
	Data         interface{} `json:"data"`
	ErrorDetails string      `json:"error_details"`
}

Jump to

Keyboard shortcuts

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