helpers

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StatusCtxKey is a context key to record a future HTTP response status code.
	StatusCtxKey = &contextKey{"Status"}
	// ContentTypeCtxKey is a context for recording a by-pass for context-type
	ContentTypeCtxKey = &contextKey{"ContentType"}
	// RenderCtxKey is a context for getting the render to use
	RenderCtxKey = &contextKey{name: "Renderer"}
)

Functions

func NoContent

func NoContent(w writeHeaderer)

NoContent returns a HTTP 204 "No Content" response.

func SetContentTypeHeader

func SetContentTypeHeader(w headerer, value string)

func SetNoSniffHeader

func SetNoSniffHeader(w headerer)

func Status

func Status(r *http.Request, status int)

Status sets a HTTP response status code hint into request context at any point during the request life-cycle. Before the Responder sends its response header it will check the StatusCtxKey

func WriteStatus

func WriteStatus(w writeHeaderer, ctx context.Context)

Types

This section is empty.

Jump to

Keyboard shortcuts

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