app

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(config AppConfig) (*App, error)

func (*App) GetSLO

func (a *App) GetSLO(ctx context.Context, req GetSLORequest) (*GetSLOResponse, error)

func (*App) ListSLOs

func (a *App) ListSLOs(ctx context.Context, req ListSLOsRequest) (*ListSLOsResponse, error)

func (*App) ListServices

func (a *App) ListServices(ctx context.Context, req ListServicesRequest) (*ListServicesResponse, error)

type AppConfig

type AppConfig struct {
	ServiceGetter storage.ServiceGetter
	SLOGetter     storage.SLOGetter
	TimeNowFunc   func() time.Time
}

type BudgetRangeType

type BudgetRangeType string
const (
	BudgetRangeTypeYearly    BudgetRangeType = "yearly"    // 365 days.
	BudgetRangeTypeQuarterly BudgetRangeType = "quarterly" // 90 days.
	BudgetRangeTypeMonthly   BudgetRangeType = "monthly"   // 30 days.
	BudgetRangeTypeWeekly    BudgetRangeType = "weekly"    // 7 days.
)

type GetSLORequest

type GetSLORequest struct {
	SLOID string
}

type GetSLOResponse

type GetSLOResponse struct {
	SLO RealTimeSLODetails
}

type ListBurnedBudgetRangeRequest

type ListBurnedBudgetRangeRequest struct {
	SLOID string
	BudgetRangeType
}

type ListBurnedBudgetRangeResponse

type ListBurnedBudgetRangeResponse struct {
	RealBurnedDataPoints              []model.DataPoint
	PerfectBurnedDataPoints           []model.DataPoint
	CurrentBurnedValuePercent         float64
	CurrentExpectedBurnedValuePercent float64
}

type ListSLIAvailabilityRangeRequest

type ListSLIAvailabilityRangeRequest struct {
	SLOID string
	From  time.Time
	To    time.Time // If missing, now is used.
}

type ListSLIAvailabilityRangeResponse

type ListSLIAvailabilityRangeResponse struct {
	AvailabilityDataPoints []model.DataPoint
}

type ListSLOsRequest

type ListSLOsRequest struct {
	FilterServiceID                   string // Used for filtering SLOs by service ID.
	FilterSearchInput                 string // Used for searching SLOs by name.
	FilterAlertFiring                 bool   // Used for filtering SLOs that have firing alerts.
	FilterPeriodBudgetConsumed        bool   // Used for filtering SLOs that have burned budget above threshold.
	FilterCurrentBurningBudgetOver100 bool   // Used for filtering SLOs that are currently burning budget over 100%.
	SortMode                          SLOListSortMode
	Cursor                            string
}

type ListSLOsResponse

type ListSLOsResponse struct {
	SLOs              []RealTimeSLODetails
	PaginationCursors PaginationCursors
}

type ListServicesRequest

type ListServicesRequest struct {
	FilterSearchInput string
	SortMode          ServiceListSortMode
	Cursor            string
}

type ListServicesResponse

type ListServicesResponse struct {
	Services          []ServiceAlerts
	PaginationCursors PaginationCursors
}

type PaginationCursors

type PaginationCursors struct {
	PrevCursor  string
	NextCursor  string
	HasNext     bool
	HasPrevious bool
}

PaginationCursor are the pagination information used for cursor based pagination.

type RealTimeSLODetails

type RealTimeSLODetails struct {
	SLO    model.SLO
	Alerts model.SLOAlerts
	Budget model.SLOBudgetDetails
}

type SLOListSortMode

type SLOListSortMode string
const (
	SLOListSortModeSLOIDAsc                     SLOListSortMode = "slo-id-asc"
	SLOListSortModeSLOIDDesc                    SLOListSortMode = "slo-id-desc"
	SLOListSortModeServiceNameAsc               SLOListSortMode = "service-name-asc"
	SLOListSortModeServiceNameDesc              SLOListSortMode = "service-name-desc"
	SLOListSortModeCurrentBurningBudgetAsc      SLOListSortMode = "current-burning-budget-asc"
	SLOListSortModeCurrentBurningBudgetDesc     SLOListSortMode = "current-burning-budget-desc"
	SLOListSortModeBudgetBurnedWindowPeriodAsc  SLOListSortMode = "budget-burned-window-period-asc"
	SLOListSortModeBudgetBurnedWindowPeriodDesc SLOListSortMode = "budget-burned-window-period-desc"
	SLOListSortModeAlertSeverityAsc             SLOListSortMode = "alert-severity-asc"
	SLOListSortModeAlertSeverityDesc            SLOListSortMode = "alert-severity-desc"
)

type ServiceAlerts

type ServiceAlerts struct {
	Service model.Service
	Stats   model.ServiceStats
	Alerts  []model.SLOAlerts
}

type ServiceListSortMode

type ServiceListSortMode string
const (
	ServiceListSortModeServiceNameAsc    ServiceListSortMode = "service-name-asc"
	ServiceListSortModeServiceNameDesc   ServiceListSortMode = "service-name-desc"
	ServiceListSortModeAlertSeverityAsc  ServiceListSortMode = "alert-severity-asc"
	ServiceListSortModeAlertSeverityDesc ServiceListSortMode = "alert-severity-desc"
)

Jump to

Keyboard shortcuts

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