render
v1.0.0
github.com/didip/chi/render
Documentation
pkg.go.dev ↗Constants
ContentTypePlainText (5 declarations)
const ( ContentTypePlainText = iota ContentTypeHTML ContentTypeJSON ContentTypeEventStream ContentTypeXML )
Functions
Bind
func Bind(r io.Reader, v interface{}) error
Bind is a short-hand method for decoding a JSON request body.
HTML
func HTML(w http.ResponseWriter, status int, v string)
JSON
func JSON(w http.ResponseWriter, status int, v interface{})
Noop
func Noop(w http.ResponseWriter)
ParseContentType
func ParseContentType(next chi.Handler) chi.Handler
Respond
func Respond(w http.ResponseWriter, status int, v interface{})
String
func String(w http.ResponseWriter, status int, v string)
XML
func XML(w http.ResponseWriter, status int, v interface{})
Types
ContentType
type ContentType int
A ContentType is an enumeration of HTTP content types.