json

package
v0.0.0-...-2d7094a Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrFailedDependency

func ErrFailedDependency(w http.ResponseWriter, err error, msg string)

func ErrNotFound

func ErrNotFound(w http.ResponseWriter, err error, msg string)

func ErrUnauthorized

func ErrUnauthorized(w http.ResponseWriter, url string)

func ErrUnprocessable

func ErrUnprocessable(w http.ResponseWriter, err error, msg string)

Types

type ErrResponse

type ErrResponse struct {
	Err            string `json:"error,omitempty"` // low-level error
	HTTPStatusCode int    `json:"-"`               // http response status code

	StatusText string `json:"status"` // user-level status message
	Redirect   string `json:",omitempty"`
}

ErrResponse presents error information to JSON API user.

Jump to

Keyboard shortcuts

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