Documentation
¶
Index ¶
- Variables
- func InstrumentHandler(method, route string, observer Interface, handler http.Handler) (string, string, http.Handler)
- func Register(observerType string, init InitFunc) error
- func Registered() []string
- type ErrObserverAlreadyExists
- type ErrObserverIsNotRegistered
- type InitFunc
- type Interface
Constants ¶
This section is empty.
Variables ¶
View Source
var NullObserver nullObserverType
Functions ¶
func InstrumentHandler ¶
func InstrumentHandler(method, route string, observer Interface, handler http.Handler) (string, string, http.Handler)
InstrumentHandler is a convenience function
Types ¶
type ErrObserverAlreadyExists ¶
type ErrObserverAlreadyExists string
ErrObserverAlreadyExists is returned if an observer try to register to an observer type that has already registered
func (ErrObserverAlreadyExists) Error ¶
func (err ErrObserverAlreadyExists) Error() string
type ErrObserverIsNotRegistered ¶
type ErrObserverIsNotRegistered string
ErrObserverIsNotRegistered is returned if a requested observer type has not been already registered
func (ErrObserverIsNotRegistered) Error ¶
func (err ErrObserverIsNotRegistered) Error() string
type Interface ¶
type Interface interface { // Handler returns a http.Handler for the metrics route Handler(route string) http.Handler // InstrumentedHttpHandler returns an http.Handler that will instrument the given http handler, for the // route and method that was given InstrumentedHttpHandler(method, route string, handler http.Handler) http.Handler // Returns the name of observer Name() string }
Interface
Click to show internal directories.
Click to hide internal directories.