response

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, code int, message string) error

Error sends a JSend-compliant response indicating an error with the passed error message.

func Fail

func Fail(w http.ResponseWriter, code int, message string) error

Fail sends a JSend-compliant response indicating failure with the passed error message.

func HTML

func HTML(w http.ResponseWriter, code int, v string) error

func JSON

func JSON(w http.ResponseWriter, code int, v any) error

func PlainText

func PlainText(w http.ResponseWriter, code int, v string) error

func Success

func Success(w http.ResponseWriter, code int, v any) error

Success sends a JSend-compliant response indicating success, with the passed data nested in it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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