package
0.38.2
Repository: https://github.com/rickb777/acceptable.git
Documentation: pkg.go.dev

# Functions

BinaryProcessor creates an output processor that outputs binary data in a form suitable for image/* and similar responses.
CSV constructs a CSV Offer easily.
CSVProcessor creates an output processor that serialises a dataModel in CSV form.
ImageJPEGPNG is an Offer for image/jpeg content using BinaryProcessor.
ImagePNG is an Offer for image/png content using BinaryProcessor.
JSON constructs a JSON Offer easily.
JSONProcessor creates a new processor for JSON with a specified indentation.
Of constructs an Offer easily, given a content type.
TextPlain returns an Offer for text/plain content using TXTProcessor.
TXTProcessor creates an output processor that serialises strings in a form suitable for text/* responses (especially text/plain and text/html).
XML constructs an XML Offer easily.
XMLProcessor creates a new processor for XML with root element and optional indentation.

# Variables

NewJSONEncoder is a pluggable JSON encoder, initialised with the standard library implementation.

# Structs

Match holds the best-matched offer after content negotiation and is used for response rendering.
Offer holds information about one particular resource representation that can potentially provide an acceptable response.

# Interfaces

JSONEncoder summarises the key methods of the standard JSON encoder.

# Type aliases

Offers holds a slice of Offer.
Processor is a function that renders content according to the matched result.