Documentation ¶
Overview ¶
Package endpoint implements the HTTP endpoints of Ayd such as status page.
Index ¶
- func HealthzEndpoint(s Store) http.HandlerFunc
- func IncidentsCSVEndpoint(s Store) http.HandlerFunc
- func IncidentsHTMLEndpoint(s Store) http.HandlerFunc
- func IncidentsJSONEndpoint(s Store) http.HandlerFunc
- func IncidentsRSSEndpoint(s Store) http.HandlerFunc
- func LogCSVEndpoint(s Store) http.HandlerFunc
- func LogHTMLEndpoint(s Store) http.HandlerFunc
- func LogJsonEndpoint(s Store) http.HandlerFunc
- func LogTSVEndpoint(s Store) http.HandlerFunc
- func MetricsEndpoint(s Store) http.HandlerFunc
- func New(s Store) http.Handler
- func StatusHTMLEndpoint(s Store) http.HandlerFunc
- func StatusJSONEndpoint(s Store) http.HandlerFunc
- func StatusTextEndpoint(s Store) http.HandlerFunc
- func TargetsJSONEndpoint(s Store) http.HandlerFunc
- func TargetsTextEndpoint(s Store) http.HandlerFunc
- func WithBasicAuth(handler http.Handler, userinfo string) http.Handler
- type BasicAuth
- type CommonHeader
- type LinkHeader
- type LogFilter
- type Query
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthzEndpoint ¶
func HealthzEndpoint(s Store) http.HandlerFunc
HealthzEndpoint is the http.HandlerFunc for /healthz page.
func IncidentsCSVEndpoint ¶ added in v0.14.0
func IncidentsCSVEndpoint(s Store) http.HandlerFunc
func IncidentsHTMLEndpoint ¶ added in v0.14.0
func IncidentsHTMLEndpoint(s Store) http.HandlerFunc
func IncidentsJSONEndpoint ¶ added in v0.14.0
func IncidentsJSONEndpoint(s Store) http.HandlerFunc
func IncidentsRSSEndpoint ¶ added in v0.14.0
func IncidentsRSSEndpoint(s Store) http.HandlerFunc
func LogCSVEndpoint ¶
func LogCSVEndpoint(s Store) http.HandlerFunc
func LogHTMLEndpoint ¶ added in v0.14.0
func LogHTMLEndpoint(s Store) http.HandlerFunc
func LogJsonEndpoint ¶
func LogJsonEndpoint(s Store) http.HandlerFunc
func LogTSVEndpoint ¶
func LogTSVEndpoint(s Store) http.HandlerFunc
func MetricsEndpoint ¶
func MetricsEndpoint(s Store) http.HandlerFunc
MetricsEndpoint implements Prometheus metrics endpoint. This endpoint follows both of Prometheus specification and OpenMetrics specification.
func StatusHTMLEndpoint ¶
func StatusHTMLEndpoint(s Store) http.HandlerFunc
func StatusJSONEndpoint ¶
func StatusJSONEndpoint(s Store) http.HandlerFunc
func StatusTextEndpoint ¶
func StatusTextEndpoint(s Store) http.HandlerFunc
func TargetsJSONEndpoint ¶ added in v0.12.0
func TargetsJSONEndpoint(s Store) http.HandlerFunc
TargetsJSONEndpoint replies target list in json format.
func TargetsTextEndpoint ¶ added in v0.12.0
func TargetsTextEndpoint(s Store) http.HandlerFunc
TargetsTextEndpoint replies target list in text.
Types ¶
type BasicAuth ¶
BasicAuth is a http.Handler wrapper that handles Basic Authorization. It supports only one pair of username and password.
type CommonHeader ¶ added in v0.13.3
func (CommonHeader) ServeHTTP ¶ added in v0.13.3
func (ch CommonHeader) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LinkHeader ¶ added in v0.13.3
type LinkHeader struct { Upstream http.HandlerFunc Link string }
func (LinkHeader) ServeHTTP ¶ added in v0.13.3
func (lh LinkHeader) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Store ¶ added in v0.12.0
type Store interface { // Path returns path to log file. Path() string // Targets returns target URLs include inactive target. Targets() []string // ProbeHistory returns a slice of ProbeHistory. ProbeHistory() []api.ProbeHistory // MakeReport creates ayd.Report for exporting for endpoint. MakeReport(probeHistoryLength int) api.Report // ReportInternalError reports Ayd internal error. ReportInternalError(scope, message string) // Errors returns a list of internal (critical) errors. Errors() (healthy bool, messages []string) // IncidentCount returns the count of incident causes. IncidentCount() int // OpenLog opens ayd.LogScanner. OpenLog(since, until time.Time) (api.LogScanner, error) }
Click to show internal directories.
Click to hide internal directories.