Documentation ¶
Overview ¶
Package serialize provides conveniency functions for serializing values to either JSON or XML
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write serializes value using the Format f and writes it to w. If w also implements http.ResponseWriter, it sets the appropiate headers too. Returns the number of bytes written and any error that might occur while serializing or writing the serialized data.
Types ¶
type JSONWriter ¶
type JSONWriter interface { // WriteJSON writes the object encoded as JSON into // the given io.Writer, returning the number of bytes // written and any potential errors. WriteJSON(w io.Writer) (int, error) }
JSONWriter is the interface implemented by types which can write themselves as JSON into an io.Writer. You can use the gondola command for generating the code to implement this interface in your own types.
Click to show internal directories.
Click to hide internal directories.