responses

package
v0.0.0-...-bee26d8 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteMessage

func WriteMessage(code int, status string, message string, w http.ResponseWriter)

Write a message with a given status code, a status and a message

func WriteUnauthorized

func WriteUnauthorized(w http.ResponseWriter)

Write a message saying that the client should provide authentication details

func WriteUnprocessableEntity

func WriteUnprocessableEntity(w http.ResponseWriter)

Write a message saying that we cannot parse the given JSON payload

Types

type APIMessage

type APIMessage struct {

	// The status key
	Status string `json:"status"`
	// A human-readable message
	Message string `json:"message"`
	// contains filtered or unexported fields
}

A simple struct to easily respond some JSON

Jump to

Keyboard shortcuts

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