Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware returns a new status middleware. It collects information about requests.
Types ¶
type RequestDuration ¶
type RequestDuration struct { Min time.Duration `json:"min"` Max time.Duration `json:"max"` Avg time.Duration `json:"avg"` }
RequestDuration tracks the duration of requests in different metrics.
type Service ¶
type Service interface { // Status returns the current status of the server. Status() Status // RequestServed tells the service, that a request was served, with a given // request duration. RequestServed(duration time.Duration) }
Service defines a a servies, that collects and provides status information about a server.
-go:generate go run github.com/petergtz/pegomock/pegomock generate eintopf.info/service/status Service --output=../../internal/mock/status_service.go --package=mock --mock-name=StatusService
Click to show internal directories.
Click to hide internal directories.