response

package
v0.0.0-...-c3cd77f Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Zlib Imports: 5 Imported by: 66

Documentation

Overview

Package response provides convenience functions to write into a http.ResponseWriter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

Empty merely sets the response code to NoContent (204).

func JSON

func JSON(rw http.ResponseWriter, data interface{}) *httperror.HandlerError

JSON encodes data to rw in JSON format. Returns a pointer to a HandlerError if encoding fails.

func YAML

func YAML(rw http.ResponseWriter, data interface{}) *httperror.HandlerError

JSON encodes data to rw in YAML format. Returns a pointer to a HandlerError if encoding fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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