API Reference¶
SLOGo is documented on pkg.go.dev with full API documentation.
Package Documentation¶
| Package | Description |
|---|---|
| slogo | Root package with Objects type and helpers |
| slogo/ontology | Core SLO ontology with 12 labeling dimensions |
| slogo/alert | Alert condition builders for OpenSLO |
| slogo/requirement | Requirement types with rate/duration goals |
Domain Ontology Packages¶
| Package | Description |
|---|---|
| ontologies/domains/iam | IAM/IGA labels |
| ontologies/domains/product | AARRR journey stages |
| ontologies/domains/business | Business verticals |
| ontologies/domains/saas | Multi-tenancy labels |
| ontologies/domains/security | Security labels |
| ontologies/domains/compliance | Regulatory frameworks |
| ontologies/domains/operations | Operational processes |
Key Types¶
Objects¶
The Objects type manages collections of OpenSLO objects:
type Objects struct {
Services []openslo.Service
SLOs []openslo.SLO
SLIs []openslo.SLI
DataSources []openslo.DataSource
AlertPolicies []openslo.AlertPolicy
AlertConditions []openslo.AlertCondition
AlertNotificationTargets []openslo.AlertNotificationTarget
}
Methods:
Add(objs ...any)- Add OpenSLO objects to the collectionWriteJSONFile(filepath string)- Write as JSONWriteYAMLFile(filepath string)- Write as YAML
Ontology Labels¶
Labels are defined as string constants:
const (
LabelFramework = "framework"
LabelLayer = "layer"
LabelScope = "scope"
LabelAudience = "audience"
LabelCategory = "category"
LabelSeverity = "severity"
LabelTier = "tier"
LabelMetricType = "metric-type"
LabelResourceType = "resource-type"
LabelService = "service"
LabelTeam = "team"
LabelEnvironment = "environment"
)
Alert Conditions¶
Build alert conditions with the builder pattern:
cond := alert.NewCondition("high-burn-rate").
WithBurnRate(14.4, "1h").
WithSeverity(alert.SeverityCritical).
Build()
Requirements¶
Define SLO requirements with targets:
req := requirement.Requirement{
Name: "API Availability",
Target: requirement.Target{
RateGoal: 99.9,
DurationGoal: "30d",
},
}
Full Documentation¶
For complete API documentation, visit: