common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package common provides shared types used across signal-spec entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateTags

func ValidateTags(tags []Tag) error

ValidateTags checks all tags are valid lower-kebab-case.

Types

type Domain

type Domain struct {
	// Name is the category (e.g., "authentication", "payments", "infrastructure").
	Name string `json:"name" jsonschema:"description=Category - the primary functional area"`

	// Subdomain is the subcategory within the domain (e.g., "oauth", "checkout", "kubernetes").
	Subdomain string `json:"subdomain,omitempty" jsonschema:"description=Subcategory within the category"`

	// Team is the owning team for this domain.
	Team string `json:"team,omitempty"`
}

Domain represents a functional area or product domain. This serves as category/subcategory classification for root causes.

type Entity

type Entity struct {
	// Type is the entity type (e.g., "service", "endpoint", "database").
	Type string `json:"type"`

	// Name is the entity identifier.
	Name string `json:"name"`

	// Attributes contains additional entity metadata.
	Attributes map[string]string `json:"attributes,omitempty"`
}

Entity represents a system component referenced by signals.

type Severity

type Severity string

Severity indicates the impact level of a signal or root cause.

const (
	SeverityCritical Severity = "critical"
	SeverityHigh     Severity = "high"
	SeverityMedium   Severity = "medium"
	SeverityLow      Severity = "low"
	SeverityInfo     Severity = "info"
)

func (Severity) JSONSchema

func (Severity) JSONSchema() *jsonschema.Schema

JSONSchema implements jsonschema.Schema for enum generation.

type SourceSystem

type SourceSystem struct {
	// Type is the source category (e.g., "ticketing", "alerting", "security").
	Type string `json:"type"`

	// Name is the specific system name (e.g., "zendesk", "pagerduty", "wiz").
	Name string `json:"name"`

	// ExternalID is the original identifier in the source system.
	ExternalID string `json:"external_id,omitempty"`

	// URL is a link to the original item in the source system.
	URL string `json:"url,omitempty"`
}

SourceSystem identifies where a signal originated.

type Tag

type Tag string

Tag is a user-defined label in lower-kebab-case format. Examples: "enterprise", "auth-related", "p0-incident", "redis-cluster"

func (Tag) Validate

func (t Tag) Validate() error

Validate checks if the tag is valid lower-kebab-case.

type TimeRange

type TimeRange struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

TimeRange represents a time interval.

Jump to

Keyboard shortcuts

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