Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, obj interface{}) error
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 HTML ¶
func (HTML) WriteContentType ¶
func (r HTML) WriteContentType(w http.ResponseWriter)
WriteContentType (HTML) writes HTML ContentType.
type HTMLProduction ¶
func (HTMLProduction) Instance ¶
func (r HTMLProduction) Instance(name string, data interface{}) Render
type HTMLRender ¶
type JSON ¶
type JSON struct {
Data interface{}
}
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 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)
}
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.