Documentation
¶
Overview ¶
Package api handles the API requests
Index ¶
- type Chain
- type Constructor
- type DataPoint
- type MonitorStats
- type Percentiles
- type PushSubscriptionKeys
- type PushSubscriptionRequest
- type Server
- func (s *Server) GetConfig(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetIncident(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetIncidents(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetMonitors(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetVAPIDPublicKey(w http.ResponseWriter, r *http.Request)
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) SubscribeToPushNotifications(w http.ResponseWriter, r *http.Request)
- func (s *Server) UnsubscribeFromPushNotifications(w http.ResponseWriter, r *http.Request)
- func (s *Server) WithCORS(h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func NewChain ¶
func NewChain(constructors ...Constructor) Chain
NewChain creates a new chain for a given list of middleware constructors
type MonitorStats ¶
type MonitorStats struct {
ID int64 `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
CheckInterval int64 `json:"check_interval"`
AvgResponseTime int64 `json:"avg_response_time"`
UptimePct float64 `json:"uptime_pct"`
Percentiles Percentiles `json:"percentiles"`
Datapoints []DataPoint `json:"data_points"`
}
type Percentiles ¶
type PushSubscriptionKeys ¶
type PushSubscriptionRequest ¶
type PushSubscriptionRequest struct {
Endpoint string `json:"endpoint"`
Keys PushSubscriptionKeys `json:"keys"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetIncident ¶
func (s *Server) GetIncident(w http.ResponseWriter, r *http.Request)
func (*Server) GetIncidents ¶
func (s *Server) GetIncidents(w http.ResponseWriter, r *http.Request)
func (*Server) GetMonitors ¶ added in v0.1.1
func (s *Server) GetMonitors(w http.ResponseWriter, r *http.Request)
func (*Server) GetVAPIDPublicKey ¶
func (s *Server) GetVAPIDPublicKey(w http.ResponseWriter, r *http.Request)
GetVAPIDPublicKey returns the VAPID public key for client subscription
func (*Server) SubscribeToPushNotifications ¶
func (s *Server) SubscribeToPushNotifications(w http.ResponseWriter, r *http.Request)
SubscribeToPushNotifications subscribes a user to push notifications for a monitor
func (*Server) UnsubscribeFromPushNotifications ¶
func (s *Server) UnsubscribeFromPushNotifications(w http.ResponseWriter, r *http.Request)
UnsubscribeFromPushNotifications unsubscribes a user from push notifications
Click to show internal directories.
Click to hide internal directories.