type EntityReaderWriter … var entityAccessRegistry … type entityReaderWriters … func init() { … } // RegisterEntityAccessor add/overrides the ReaderWriter for encoding content with this MIME type. func RegisterEntityAccessor(mime string, erw EntityReaderWriter) { … } // NewEntityAccessorJSON returns a new EntityReaderWriter for accessing JSON content. // This package is already initialized with such an accessor using the MIME_JSON contentType. func NewEntityAccessorJSON(contentType string) EntityReaderWriter { … } // NewEntityAccessorXML returns a new EntityReaderWriter for accessing XML content. // This package is already initialized with such an accessor using the MIME_XML contentType. func NewEntityAccessorXML(contentType string) EntityReaderWriter { … } // accessorAt returns the registered ReaderWriter for this MIME type. func (r *entityReaderWriters) accessorAt(mime string) (EntityReaderWriter, bool) { … } type entityXMLAccess … // Read unmarshalls the value from XML func (e entityXMLAccess) Read(req *Request, v interface{ … } // Write marshalls the value to JSON and set the Content-Type Header. func (e entityXMLAccess) Write(resp *Response, status int, v interface{ … } // writeXML marshalls the value to JSON and set the Content-Type Header. func writeXML(resp *Response, status int, contentType string, v interface{ … } type entityJSONAccess … // Read unmarshalls the value from JSON func (e entityJSONAccess) Read(req *Request, v interface{ … } // Write marshalls the value to JSON and set the Content-Type Header. func (e entityJSONAccess) Write(resp *Response, status int, v interface{ … } // write marshalls the value to JSON and set the Content-Type Header. func writeJSON(resp *Response, status int, contentType string, v interface{ … }