response

package
Version: v0.0.0-...-49abefd Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package response holds utility functions related to http response handling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteErr

func WriteErr(w http.ResponseWriter, r *http.Request, err error) error

WriteErr writes an appropriate error message into the http response. It'll write a respose status code from either 4xx or 5xx category

func WriteSuccess

func WriteSuccess(w http.ResponseWriter, r *http.Request, b interface{}, id interface{}) error

WriteSuccess writes to the response with appropriate status and headers

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL