Documentation ¶
Overview ¶
Package response contains utility functions for creating HTTP responses.
Index ¶
- type Response
- func ClickReport(filename string, report <-chan *db.ClickReport) *Response
- func Error(status int, err error) *Response
- func Func(fn func(w http.ResponseWriter) error) *Response
- func JSON(status int, json interface{}) *Response
- func Redirect(status int, location string) *Response
- func Status(status int) *Response
- func Text(status int, text string) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
A Response represents the content that will populate an HTTP response.
func ClickReport ¶
func ClickReport(filename string, report <-chan *db.ClickReport) *Response
ClickReport generates a tab-separated-value file.
func Func ¶
func Func(fn func(w http.ResponseWriter) error) *Response
Func will execute an arbitrary callback to handle response construction. This is useful for streaming data responses.
Click to show internal directories.
Click to hide internal directories.