response

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package response provides a set of utilities for writing responses to an http.ResponseWriter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeETagJSON

func ServeETagJSON(w http.ResponseWriter, r *http.Request, statusCode int, data interface{})

ServeETagJSON serves the supplied data as JSON and includes an ETag for 2xx status codes

func ServeJSON

func ServeJSON(w http.ResponseWriter, r *http.Request, statusCode int, data interface{})

ServeJSON serves the supplied data as JSON

func ServeNoContent

func ServeNoContent(w http.ResponseWriter, r *http.Request, statusCode int)

ServeNoContent serves the status code only, with no content body or Content-Type headers.

func ServeString

func ServeString(w http.ResponseWriter, r *http.Request, statusCode int, data string)

ServeString serves the data parameter as the output from the request with no processing on the data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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