Documentation
¶
Index ¶
- Variables
- func LoadDiscoveredRoutes(apiV1Router *mux.Router, services ServicesInterface, ...)
- func MetricsMiddleware(handler http.Handler) http.Handler
- func RegisterRoutes(name string, registrationFunc RouteRegistrationFunc)
- func ResetMetricCollectors()
- type ListenNotifier
- type RouteRegistrationFunc
- type Server
- type ServicesInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var MetricsLabels = []string{
metricsMethodLabel,
metricsPathLabel,
metricsCodeLabel,
}
MetricsLabels - Array of labels added to metrics:
View Source
var MetricsNames = []string{
requestCount,
requestDuration,
}
MetricsNames - Array of Names of the metrics:
View Source
var PathVarSub = "-"
PathVarSub replaces path variables to a same character
Functions ¶
func LoadDiscoveredRoutes ¶
func LoadDiscoveredRoutes(apiV1Router *mux.Router, services ServicesInterface, authMiddleware auth.JWTMiddleware, authzMiddleware auth.AuthorizationMiddleware)
func MetricsMiddleware ¶
MetricsMiddleware creates a new handler that collects metrics for the requests processed by the given handler.
func RegisterRoutes ¶
func RegisterRoutes(name string, registrationFunc RouteRegistrationFunc)
func ResetMetricCollectors ¶
func ResetMetricCollectors()
ResetMetricCollectors resets all prometheus collectors
Types ¶
type ListenNotifier ¶
type ListenNotifier interface {
NotifyListening() <-chan struct{}
}
ListenNotifier is an optional interface that servers can implement to signal when they are ready to accept connections
type RouteRegistrationFunc ¶
type RouteRegistrationFunc func(apiV1Router *mux.Router, services ServicesInterface, authMiddleware auth.JWTMiddleware, authzMiddleware auth.AuthorizationMiddleware)
type Server ¶
func NewAPIServer ¶
func NewAPIServer() Server
func NewHealthServer ¶
func NewHealthServer() Server
func NewMetricsServer ¶
func NewMetricsServer() Server
type ServicesInterface ¶
type ServicesInterface interface {
GetService(name string) interface{}
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.