httputils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RespondIfError

func RespondIfError(code *int, err *error, w http.ResponseWriter, r *http.Request)

RespondIfError if err != nil, returns the HTTPError and code as API response no-op if the err is nil

Types

type HTTPError

type HTTPError struct {
	Message string `json:"message"`
}

HTTPError contains the error message

Jump to

Keyboard shortcuts

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