helper

package
v0.0.0-...-9a1e315 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EmptyValue define an empty value for error message
	EmptyValue = make([]int, 0)
)

Functions

func ParamValidation

func ParamValidation(next echo.HandlerFunc) echo.HandlerFunc

ParamValidation validate the paramater of the request.

Types

type Response

type Response struct {
	Status Status      `json:"status"`
	Data   interface{} `json:"data"`
}

Response defines the structure of the response entity.

func SetResponse

func SetResponse(code int, message string, data interface{}) *Response

SetResponse set the structure of the JSON response.

type Status

type Status struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Status defines the structure of the status entity for the response.

Jump to

Keyboard shortcuts

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