responses

package
v0.0.0-...-d78814b Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFound   func(http.ResponseWriter, *http.Request, string)
	Forbidden  func(http.ResponseWriter, *http.Request, string)
	BadRequest func(http.ResponseWriter, *http.Request, string)
	Error      func(http.ResponseWriter, *http.Request, string)
)

Error handlers to be filled in by the blog app.

Functions

func Flash

func Flash(w http.ResponseWriter, r *http.Request, message string, args ...interface{})

Flash adds a flash message to the user's session.

func FlashAndRedirect

func FlashAndRedirect(w http.ResponseWriter, r *http.Request, location, message string, args ...interface{})

FlashAndRedirect flashes and redirects in one go.

func FlashAndReload

func FlashAndReload(w http.ResponseWriter, r *http.Request, message string, args ...interface{})

FlashAndReload flashes and sends a redirect to the same path.

func JSON

func JSON(w http.ResponseWriter, statusCode int, v interface{})

JSON serializes a JSON response to the browser.

func Redirect

func Redirect(w http.ResponseWriter, location string)

Redirect sends an HTTP redirect response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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