echoresponse

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 1 Imported by: 0

README

Echo Framework Response Formatter

This is a VERY opinionated package to format HTTP responses. It absolutely depends on Echo Framework

Response Format

It returns JSON responses only Two keys are a present in the JSON string.

msg => string

payload => interface{}

payload could be anything. Map, List, Int, String

Why?

I got tired of writing and duplicating the same code across most of my projects.

Use it if you want/like/don't like :)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(c echo.Context, message any, payload any, statusCode int) error

func FormatResponse

func FormatResponse(c echo.Context, message any, payload any, statusCode int) error

DEPRECATED: use Format instead

Types

type Payload

type Payload map[string]any

Jump to

Keyboard shortcuts

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