Documentation ¶
Index ¶
- func ResponseStatus(ctx context.Context, statusCode int) string
- func WithAccessLog(x xstats.XStater, l ...log.Logger) mw.Middleware
- type BlackholeXStat
- func (BlackholeXStat) AddTags(tags ...string)
- func (BlackholeXStat) Count(stat string, count float64, tags ...string)
- func (BlackholeXStat) Gauge(stat string, value float64, tags ...string)
- func (BlackholeXStat) Histogram(stat string, value float64, tags ...string)
- func (BlackholeXStat) Timing(stat string, duration time.Duration, tags ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResponseStatus ¶
ResponseStatus checks the context for timeout, canceled, ok or error. Used in WithAccessLog().
func WithAccessLog ¶
WithAccessLog is a middleware that logs all access requests performed on the sub handler and uses github.com/rs/xstats for collecting stats. Default logger uses black hole engine. Log level must be set to info. Logger must be thread safe.
Types ¶
type BlackholeXStat ¶
type BlackholeXStat struct{}
BlackholeXStat provides a type to disable the stats.
func (BlackholeXStat) AddTags ¶
func (BlackholeXStat) AddTags(tags ...string)
AddTags implements XStats interface
func (BlackholeXStat) Count ¶
func (BlackholeXStat) Count(stat string, count float64, tags ...string)
Count implements XStats interface
func (BlackholeXStat) Gauge ¶
func (BlackholeXStat) Gauge(stat string, value float64, tags ...string)
Gauge implements XStats interface
Click to show internal directories.
Click to hide internal directories.