Documentation
¶
Index ¶
- func EncodeCursor(c Cursor) (string, error)
- func Routes(h *Handler) chi.Router
- type AppliedFilters
- type Cursor
- type Handler
- type Incident
- type IncidentResponse
- type LatestAlertResponse
- type ListFilters
- type ListIncidentsOptions
- type ListIncidentsPage
- type ListIncidentsResponse
- type Repository
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCursor ¶
Types ¶
type AppliedFilters ¶
type Cursor ¶
func DecodeCursor ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) GetIncident ¶
func (h *Handler) GetIncident(w http.ResponseWriter, r *http.Request)
func (*Handler) ListIncidents ¶
func (h *Handler) ListIncidents(w http.ResponseWriter, r *http.Request)
type IncidentResponse ¶
type IncidentResponse struct {
ID string `json:"id"`
MonitorID string `json:"monitor_id"`
MonitorURL string `json:"monitor_url"`
StartTime string `json:"start_time"`
EndTime *string `json:"end_time,omitempty"`
Alerted bool `json:"alerted"`
HTTPStatus int32 `json:"http_status"`
LatencyMs int32 `json:"latency_ms"`
CreatedAt string `json:"created_at"`
IsActive bool `json:"is_active"`
DurationSec int64 `json:"duration_sec"`
LatestAlert *LatestAlertResponse `json:"latest_alert,omitempty"`
}
type LatestAlertResponse ¶
type ListFilters ¶
type ListIncidentsOptions ¶
type ListIncidentsOptions struct {
Limit int32
Cursor *Cursor
Filters ListFilters
}
type ListIncidentsPage ¶
type ListIncidentsPage struct {
Incidents []Incident
HasMore bool
NextCursor *string
Applied ListFilters
Limit int32
}
type ListIncidentsResponse ¶
type ListIncidentsResponse struct {
Limit int32 `json:"limit"`
HasMore bool `json:"has_more"`
NextCursor *string `json:"next_cursor,omitempty"`
AppliedFilters AppliedFilters `json:"applied_filters"`
Incidents []IncidentResponse `json:"incidents"`
}
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(dbExecutor db.DBTX, logger *zerolog.Logger) *Repository
func (*Repository) GetByIDAndUserID ¶
func (*Repository) ListByUserID ¶
func (r *Repository) ListByUserID(ctx context.Context, userID uuid.UUID, opts ListIncidentsOptions) ([]Incident, bool, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *Repository) *Service
func (*Service) GetByIDAndUserID ¶
func (*Service) ListByUserID ¶
func (s *Service) ListByUserID(ctx context.Context, userID uuid.UUID, opts ListIncidentsOptions) (ListIncidentsPage, error)
Click to show internal directories.
Click to hide internal directories.