Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, obj interface{}) error
Types ¶
type JSON ¶
type JSON struct {
Data interface{}
}
JSON contains the given interface object.
func (JSON) Render ¶
func (r JSON) Render(w http.ResponseWriter) (err error)
Render (JSON) writes data with custom ContentType.
func (JSON) WriteContentType ¶
func (r JSON) WriteContentType(w http.ResponseWriter)
WriteContentType (JSON) writes JSON ContentType.
type Render ¶
type Render interface { // Render writes data with custom ContentType. Render(http.ResponseWriter) error // WriteContentType writes custom ContentType. WriteContentType(w http.ResponseWriter) }
Render interface is to be implemented by JSON, XML, HTML, YAML and so on.
Click to show internal directories.
Click to hide internal directories.