status

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCategoryNotFound = fmt.Errorf("category not found")

Functions

This section is empty.

Types

type CategoryService

type CategoryService struct {
	ID            primitive.ObjectID     `json:"id"`
	Name          string                 `json:"name"`
	Description   string                 `json:"description"`
	Status        models.ComponentStatus `json:"status"`
	UpdatedAt     time.Time              `json:"updatedAt"`
	Uptime30d     *float64               `json:"uptime30d"`
	UptimeHistory []DailyUptimeBar       `json:"uptimeHistory"`
}

type CategorySummary

type CategorySummary struct {
	Prefix          string                       `json:"prefix"`
	Name            string                       `json:"name"`
	Description     string                       `json:"description"`
	AggregateStatus string                       `json:"aggregateStatus"`
	HasMonitoring   bool                         `json:"hasMonitoring"`
	Uptime30d       *float64                     `json:"uptime30d"`
	Services        []CategoryService            `json:"services"`
	Incidents       []models.IncidentWithUpdates `json:"incidents"`
}

type ComponentWithSubStatusInfo

type ComponentWithSubStatusInfo struct {
	models.Component
	SubComponents []models.SubComponent `json:"subComponents"`
	UptimeHistory []DailyUptimeBar      `json:"uptimeHistory"`
	LastIncident  *IncidentStatusInfo   `json:"lastIncident,omitempty"`
}

type DailyUptimeBar

type DailyUptimeBar struct {
	Date          string  `json:"date"`
	UptimePercent float64 `json:"uptimePercent"`
	Status        string  `json:"status"`
}

type IncidentStatusInfo

type IncidentStatusInfo struct {
	Date     time.Time `json:"date"`
	Duration string    `json:"duration"`
	Title    string    `json:"title"`
}

type IncidentsResponse

type IncidentsResponse struct {
	Active   []models.IncidentWithUpdates `json:"active"`
	Resolved []models.IncidentWithUpdates `json:"resolved"`
}

type ResolvedServiceMetricsInput

type ResolvedServiceMetricsInput struct {
	ServiceID primitive.ObjectID
	Now       time.Time
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(repo repository.StatusRepository) *Service

func (*Service) BuildCategorySummary

func (s *Service) BuildCategorySummary(ctx context.Context, prefix string) (*CategorySummary, error)

func (*Service) BuildComponents

func (s *Service) BuildComponents(ctx context.Context, now time.Time) ([]ComponentWithSubStatusInfo, error)

func (*Service) BuildIncidents

func (s *Service) BuildIncidents(ctx context.Context, now time.Time, startDate, endDate *time.Time) (*IncidentsResponse, error)

func (*Service) BuildServiceMetrics

func (s *Service) BuildServiceMetrics(ctx context.Context, serviceID primitive.ObjectID, now time.Time) (*ServiceMetrics, error)

func (*Service) BuildSummary

func (s *Service) BuildSummary(ctx context.Context, now time.Time) (*StatusSummary, error)

type ServiceAvailabilityMetrics

type ServiceAvailabilityMetrics struct {
	Last30Days float64 `json:"last30Days"`
}

type ServiceLatencyMetrics

type ServiceLatencyMetrics struct {
	P90 float64 `json:"p90"`
	P99 float64 `json:"p99"`
}

type ServiceMetrics

type ServiceMetrics struct {
	Latency      *ServiceLatencyMetrics       `json:"latency,omitempty"`
	Availability *ServiceAvailabilityMetrics  `json:"availability,omitempty"`
	History      []ServiceMetricsHistoryEntry `json:"history"`
}

type ServiceMetricsHistoryEntry

type ServiceMetricsHistoryEntry struct {
	Month        string                `json:"month"`
	Latency      ServiceLatencyMetrics `json:"latency"`
	Availability float64               `json:"availability"`
}

type StatusSummary

type StatusSummary struct {
	OverallStatus        string         `json:"overallStatus"`
	ComponentCounts      map[string]int `json:"componentCounts"`
	ActiveIncidents      int            `json:"activeIncidents"`
	ScheduledMaintenance int            `json:"scheduledMaintenance"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL