Deprecated: Please upgrade to the latest major version: go get github.com/go-chi/chi/v5
package render
import "github.com/go-chi/chi/render"
Index ¶
- Constants
- func Bind(r io.Reader, v interface{}) error
- func HTML(w http.ResponseWriter, status int, v string)
- func JSON(w http.ResponseWriter, status int, v interface{})
- func Noop(w http.ResponseWriter)
- func ParseContentType(next chi.Handler) chi.Handler
- func Respond(w http.ResponseWriter, status int, v interface{})
- func String(w http.ResponseWriter, status int, v string)
- func XML(w http.ResponseWriter, status int, v interface{})
- type ContentType
Constants ¶
const ( ContentTypePlainText = iota ContentTypeHTML ContentTypeJSON ContentTypeEventStream ContentTypeXML )
Functions ¶
func Bind ¶
Bind is a short-hand method for decoding a JSON request body.
func HTML ¶
func HTML(w http.ResponseWriter, status int, v string)
func JSON ¶
func JSON(w http.ResponseWriter, status int, v interface{})
func Noop ¶
func Noop(w http.ResponseWriter)
func ParseContentType ¶
func Respond ¶
func Respond(w http.ResponseWriter, status int, v interface{})
func String ¶
func String(w http.ResponseWriter, status int, v string)
func XML ¶
func XML(w http.ResponseWriter, status int, v interface{})
Types ¶
type ContentType ¶
type ContentType int
A ContentType is an enumeration of HTTP content types.
Source Files ¶
bind.go content_type.go render.go
- Version
- v1.0.0
- Published
- Jun 22, 2016
- Platform
- js/wasm
- Imports
- 10 packages
- Last checked
- 4 days ago –
Tools for package owners.