Documentation
¶
Index ¶
- func LogRequest(nextHandler httprouter.Handle, extras ...ExtraField) httprouter.Handle
- func NewDurationMetricWrapper(opts ...durationMetricWrapperOptsFunc) *durationMetricWrapper
- func WithCollector(c metrics.Collector) durationMetricWrapperOptsFunc
- func WithMetricsConf(conf MetricsConfig) durationMetricWrapperOptsFunc
- type ExtraField
- type MetricsConfig
- type MetricsWrapper
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogRequest ¶
func LogRequest(nextHandler httprouter.Handle, extras ...ExtraField) httprouter.Handle
func NewDurationMetricWrapper ¶
func NewDurationMetricWrapper(opts ...durationMetricWrapperOptsFunc) *durationMetricWrapper
func WithCollector ¶
func WithMetricsConf ¶
func WithMetricsConf(conf MetricsConfig) durationMetricWrapperOptsFunc
Types ¶
type ExtraField ¶
type MetricsConfig ¶
type MetricsConfig struct {
App string `toml:"app" yaml:"app" env:"METRICS_APP_VALUE"`
PrometheusHost string `toml:"prometheus_host" yaml:"prometheus_host" env:"PROMETHEUS_HOST"`
PrometheusUsername string `toml:"prometheus_username" yaml:"prometheus_username" env:"PROMETHEUS_USERNAME"`
PrometheusPassword string `toml:"prometheus_password" yaml:"prometheus_password" env:"PROMETHEUS_PASSWORD"`
}
type MetricsWrapper ¶
type MetricsWrapper interface {
Wrapper
MetricsHandler() httprouter.Handle
}
type Wrapper ¶
type Wrapper interface {
Wrap(nextHandler httprouter.Handle) httprouter.Handle
}
Click to show internal directories.
Click to hide internal directories.