requirement

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionSpec

type ActionSpec struct {
	Type        string   `json:"type" yaml:"type"`               // e.g. "HTTP", "SQL", "Business", "Job"
	Method      string   `json:"method" yaml:"method"`           // e.g. "GET", "POST", "SELECT", "INSERT"
	Target      string   `json:"target" yaml:"target"`           // e.g. "/api/v1/users" or "SELECT * FROM users"
	Service     string   `json:"service" yaml:"service"`         // optional: logical service name
	Environment string   `json:"environment" yaml:"environment"` // optional: "prod", "staging"
	Tags        []string `json:"tags" yaml:"tags"`               // optional: arbitrary labels
}

ActionSpec describes the target action or process for the SLORequirement.

type DurationGoal

type DurationGoal struct {
	Duration   duration.Spec
	Comparison cmputil.Operator `json:"comparison" yaml:"comparison"` // gt/gte/lt/lte
}

type RateGoal

type RateGoal struct {
	Value            float64          `json:"value" yaml:"value"`
	Comparison       cmputil.Operator `json:"comparison" yaml:"comparison"` // gt/gte/lt/lte
	EvaluationWindow duration.Spec    `json:"evaluationWindow" yaml:"evaluationWindow"`
}

type Requirement

type Requirement struct {
	Name        string `json:"name" yaml:"name"`
	DisplayName string `json:"displayName" yaml:"displayName"`
	Summary     string `json:"summary" yaml:"summary"`
	Description string `json:"description" yaml:"description"`
	// Goal        float64 `json:"goal" yaml:"goal"`
	// Comparison       cmputil.Operator    `json:"comparison" yaml:"comparison"` // gt/gte/lt/lte
	// TimeTarget       duration.Spec       `json:"timeTarget" yaml:"timeTarget"`
	Target Target `json:"target" yaml:"target"`
	// DurationGoal DurationGoal `json:"durationGoal" yaml:"durationGoal"`
	// RateGoal     RateGoal     `json:"rateGoal" yaml:"rateGoal"`
	// EvaluationWindow duration.Spec       `json:"evaluationWindow" yaml:"evaluationWindow"`
	Severity Severity            `json:"severity" yaml:"severity"`
	Owner    string              `json:"owner" yaml:"owner"`
	Action   ActionSpec          `json:"action" yaml:"action"`
	Labels   map[string][]string `json:"labels" yaml:"labels"`
}

type Requirements

type Requirements []Requirement

func (Requirements) Table

func (reqs Requirements) Table() *table.Table

type Severity

type Severity string
const (
	ActionTypeHTTP = "HTTP"
	ActionTypeSQL  = "SQL"

	SeverityCritical      Severity = "critical"
	SeverityHigh          Severity = "high"
	SeverityMedium        Severity = "medium"
	SeverityLow           Severity = "low"
	SeverityInformational Severity = "informational"
	SeverityUnknown       Severity = "unknown"
)

type Target

type Target struct {
	DurationGoal *DurationGoal `json:"durationGoal" yaml:"durationGoal"`
	RateGoal     RateGoal      `json:"rateGoal" yaml:"rateGoal"`
}

func (Target) DurationComparisonString

func (t Target) DurationComparisonString() string

func (Target) DurationUnitString

func (t Target) DurationUnitString() string

func (Target) DurationValueString

func (t Target) DurationValueString() string

Jump to

Keyboard shortcuts

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