render

package
v0.0.0-...-90b39c7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package render handles the rending of common API results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, status int, err error)

Error writes an API error to the response.

func JSON

func JSON(w http.ResponseWriter, status int, payload interface{})

JSON writes a payload as json to the response.

func JSONWithHeaders

func JSONWithHeaders(w http.ResponseWriter, status int, headers map[string]string, payload interface{})

JSONWithHeaders writes a payload as json to the response and includes the provided headers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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