Documentation ¶
Index ¶
Constants ¶
View Source
const PutMetric key = 0
Variables ¶
This section is empty.
Functions ¶
func DefaultAfter ¶
func DefaultAfter(m *Middleware, req *http.Request, res negroni.ResponseWriter, latency time.Duration, remoteAddr string)
DefaultAfter is the default func assigned to *Middleware.After
func DefaultBefore ¶
func DefaultBefore(m *Middleware, req *http.Request, remoteAddr string)
DefaultBefore is the default func assigned to *Middleware.Before
Types ¶
type AfterFunc ¶
type AfterFunc func(*Middleware, *http.Request, negroni.ResponseWriter, time.Duration, string)
AfterFunc is the func type called after calling the next func in the middleware chain
type Middleware ¶
type Middleware struct { // CW Service Service *cw.CloudWatch // CW namespace Namespace string // Latency metric name LatencyMetricName string Before BeforeFunc After AfterFunc PutMetric func(data []*cw.MetricDatum) // contains filtered or unexported fields }
Middleware handler
func New ¶
func New(region, namespace string) *Middleware
func (*Middleware) ExcludeURL ¶
func (m *Middleware) ExcludeURL(u string) error
ExcludeURL adds a new URL u to be ignored during logging. The URL u is parsed, hence the returned error
func (*Middleware) ExcludedURLs ¶
func (m *Middleware) ExcludedURLs() []string
ExcludedURLs returns the list of excluded URLs for this middleware
func (*Middleware) ServeHTTP ¶
func (m *Middleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.