api

package
v0.0.0-...-f29fa9d Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatJSON is the format constant for a JSON output
	FormatJSON = "json"
	// FormatJSONP is the format constant for a JSONP output
	FormatJSONP = "jsonp"
	// FormatXML is the format constant for a XML output
	FormatXML = "xml"
)

Variables

View Source
var (
	// ErrMissingCallback is thrown when the request is missing the
	// callback queryparam
	ErrMissingCallback = echo.NewHTTPError(http.StatusBadRequest,
		"Missing callback queryparam")
	// ErrUnsupportedFormat is thrown when the requestor has
	// defined an unsupported response format
	ErrUnsupportedFormat = echo.NewHTTPError(http.StatusBadRequest,
		"Unsupported format specified")
)

Functions

func FormatEncoder

func FormatEncoder(c echo.Context, code int, res interface{}) error

FormatEncoder is an encoder that reads the format from the passed echo context and writes the status code and response based on that format on the URL

Types

This section is empty.

Jump to

Keyboard shortcuts

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