echoresponse

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 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 interface{}, payload interface{}, statusCode int) error

func FormatResponse

func FormatResponse(c echo.Context, message interface{}, payload interface{}, statusCode int) error

Types

type Payload

type Payload map[string]interface{}

Jump to

Keyboard shortcuts

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