response

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIResponseError

func APIResponseError(w http.ResponseWriter, err APIError)

APIResponseError in normalized format

func JSON

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

JSON response

Types

type APIError

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

APIError Normalized struct for an API error

type Error

type Error struct {
	Status string    `json:"status"`
	Error  *APIError `json:"error"`
}

Error is a normalized data wrapper

Source Files

  • response.go

Jump to

Keyboard shortcuts

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