response

package
v0.0.0-...-f6272d2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(w http.ResponseWriter, r *http.Request, err error, code int, message string)

Errorf return an new error response

func Write

func Write(w http.ResponseWriter, r *http.Request, data interface{})

Write return a new json response

Types

type Error

type Error struct {
	Error   bool   `json:"error"`
	Code    int    `json:"statusCode"`
	Message string `json:"message"`
}

Error represents the structure of an error message

Jump to

Keyboard shortcuts

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