Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteString ¶
func WriteString(w http.ResponseWriter, format string, data []interface{}) (err error)
WriteString writes data according to its format and write custom ContentType.
Types ¶
type Redirect ¶
Redirect contains the http request reference and redirects status code and location.
func (Redirect) Render ¶
func (r Redirect) Render(w http.ResponseWriter) error
Render (Redirect) redirects the http request to new location and writes redirect response.
func (Redirect) WriteContentType ¶
func (r Redirect) WriteContentType(http.ResponseWriter)
WriteContentType (Redirect) don't write any 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.
type String ¶
type String struct { Format string Data []interface{} }
String contains the given interface object slice and its format.
func (String) Render ¶
func (r String) Render(w http.ResponseWriter) error
Render (String) writes data with custom ContentType.
func (String) WriteContentType ¶
func (r String) WriteContentType(w http.ResponseWriter)
WriteContentType (String) writes Plain ContentType.
Click to show internal directories.
Click to hide internal directories.