errresponse

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package errresponse implements a custom error renderer for the kobs api as it is described in the chi rest api example, which can be found here: https://github.com/go-chi/chi/blob/master/_examples/rest/main.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(w http.ResponseWriter, r *http.Request, err error, status int, msg string)

Render sets the given status for the response and then returns the error and message as JSON object.

Types

type ErrResponse

type ErrResponse struct {
	Error string `json:"error"`
}

ErrResponse renderer type for handling all sorts of errors.

Jump to

Keyboard shortcuts

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