Documentation ¶
Index ¶
- func End[T Respond](rp T, w http.ResponseWriter, r *http.Request)
- func ErrorAndEnd[T Respond](rp T, err error, w http.ResponseWriter, r *http.Request)
- func Start[T Respond](rp T, w http.ResponseWriter, r *http.Request)
- func Stop[T Respond](rp T, w http.ResponseWriter, r *http.Request)
- type DataAge
- type RequestTimings
- type Respond
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorAndEnd ¶
Types ¶
type RequestTimings ¶
type RequestTimings struct { Start time.Time `json:"start"` End time.Time `json:"end"` Seconds float64 `json:"duration"` }
func (*RequestTimings) Duration ¶
func (rt *RequestTimings) Duration() time.Duration
type Respond ¶
type Respond interface { StatusGet() int StatusSet(status int) ErrorAdd(err error) ErrorGet() []string Timer() *RequestTimings }
type Response ¶
type Response struct { RequestTimer *RequestTimings `json:"request_timings,omitempty"` DataAge *DataAge `json:"data_age"` StatusCode int `json:"status"` Errors []string `json:"errors"` StartDate string `json:"start_date"` EndDate string `json:"end_date"` DateRange []string `json:"date_range"` // hide all of these, only used on the front reader Organisation string `json:"-"` PageTitle string `json:"-"` Rows map[string]map[string]interface{} `json:"-"` // contains filtered or unexported fields }
func (*Response) Timer ¶
func (rp *Response) Timer() *RequestTimings
Click to show internal directories.
Click to hide internal directories.