response

package
v0.0.0-...-d081b09 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BindFailed      = "bind_failed"
	Ok              = "ok"
	RecordCreated   = "record_created"
	RecordUpdated   = "record_updated"
	RecordDeleted   = "record_deleted"
	UnexpectedError = "unexpected_error"
	AuthError       = "authorization_error"
)

Variables

This section is empty.

Functions

func HTTPErrorHandler

func HTTPErrorHandler(err error, c echo.Context)

Types

type API

type API struct{}

func New

func New() API

New returns a new response API

func (API) BindFailed

func (a API) BindFailed(err error) error

func (API) Created

func (a API) Created(data interface{}) (int, model.MessageResponse)

func (API) Deleted

func (a API) Deleted(data interface{}) (int, model.MessageResponse)

func (API) Error

func (a API) Error(c echo.Context, who string, err error) *model.Error

func (API) OK

func (a API) OK(data interface{}) (int, model.MessageResponse)

func (API) Updated

func (a API) Updated(data interface{}) (int, model.MessageResponse)

Jump to

Keyboard shortcuts

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