response

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c echo.Context, message string, data interface{}, error interface{}) error

func InternalServerError

func InternalServerError(c echo.Context, message string, data interface{}, error interface{}) error

func NotFound

func NotFound(c echo.Context, message string, data interface{}, error interface{}) error

func Paginate

func Paginate(c echo.Context, message string, paginator *paging.OffsetPaginator, data interface{}, error interface{}) error

func SingleData

func SingleData(c echo.Context, message string, data interface{}, error interface{}) error

func Unauthorized

func Unauthorized(c echo.Context, message string, data interface{}, error interface{}) error

func ValidationError

func ValidationError(c echo.Context, message string, data interface{}, error interface{}) error

Types

type APIError

type APIError struct {
	Code    int    `json:"code,omitempty"`
	Type    string `json:"type,omitempty"`
	Field   string `json:"field,omitempty"`
	Message string `json:"message"`
}

APIError

type Link struct {
	NextPageUrl string `json:"next_page_url"`
	PrevPageUrl string `json:"prev_page_url"`
}

type Meta

type Meta struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Error   interface{} `json:"error"`
}

type MetaPaginator

type MetaPaginator struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Error   interface{} `json:"error"`
	Page    Paginator   `json:"page"`
}

type Paginator

type Paginator struct {
	Total  int64 `json:"total"`
	Limit  int64 `json:"limit"`
	Offset int64 `json:"offset"`
	Link   Link  `json:"links"`
}

type Paging

type Paging struct {
	MetaPaginator MetaPaginator `json:"meta"`
	Data          interface{}   `json:"data, omitempty"`
}

type Single

type Single struct {
	Meta Meta        `json:"meta"`
	Data interface{} `json:"data, omitempty"`
}

Jump to

Keyboard shortcuts

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