Documentation
¶
Overview ¶
Package processor contains flexible implementations for rendering JSON, XML, CSV etc. A Processor is defined as
type Processor func(w http.ResponseWriter, match Match, template string, dataModel interface{}) error
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSON ¶
func JSON(indent ...string) acceptable.Processor
JSON creates a new processor for JSON with a specified indentation. It handles all requests except Ajax requests.
func TXT ¶
func TXT() acceptable.Processor
TXT creates an output processor that serialises strings in text/plain form. Model values should be one of the following:
* string
* fmt.Stringer
* encoding.TextMarshaler
func WriteWithNewline ¶
WriteWithNewline is a helper function that writes some bytes to a Writer. If the byte slice is empty or if the last byte is *not* newline, an extra newline is also written, as required for HTTP responses.
func XML ¶
func XML(indent ...string) acceptable.Processor
XML creates a new processor for XML with optional indentation.
Types ¶
This section is empty.