Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidToken is returned when the request token is invalid. ErrInvalidToken = errors.New("invalid or missing token") )
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct{}
Logger implements the required logging interface for the http handler.
type Metrics ¶
type Metrics struct { Namespace string Token string Registry *prometheus.Registry }
Metrics simply defines the basic metrics including the registry.
func (*Metrics) Handler ¶
func (m *Metrics) Handler() http.HandlerFunc
Handler initializes the prometheus middleware.
func (*Metrics) RegisterCounter ¶
func (m *Metrics) RegisterCounter(counter *prometheus.CounterVec) *prometheus.CounterVec
RegisterCounter is used to transparently register a new counter.
func (*Metrics) RegisterHistogram ¶
func (m *Metrics) RegisterHistogram(histogram *prometheus.HistogramVec) *prometheus.HistogramVec
RegisterHistogram is used to transparently register a new histogram.
type Option ¶
type Option func(o *Options)
Option defines a single option function.
func WithNamespace ¶
WithNamespace provides a function to set the namespace option.
Click to show internal directories.
Click to hide internal directories.