httperror

package
v0.7.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorJSON

func ErrorJSON(w http.ResponseWriter, error string, code int)

ErrorJSON writes the provided error as a JSON body to the provided http.ResponseWriter, after setting the appropriate Content-Type header

Types

type ServerErrMessage

type ServerErrMessage struct {
	Reason string `json:"reason"`
}

A ServerErrMessage represents the reason why the error happened

Jump to

Keyboard shortcuts

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