core

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrNotLeader          = "NOT_LEADER"
	ErrLeadershipLost     = "LEADERSHIP_LOST"
	ErrTimeout            = "TIMEOUT"
	ErrShutdown           = "SHUTDOWN"
	ErrUnknownPeer        = "UNKNOWN_PEER"
	ErrPeerExists         = "PEER_EXISTS"
	ErrTooManyPeers       = "TOO_MANY_PEERS"
	ErrInvalidConfig      = "INVALID_CONFIG"
	ErrLogNotFound        = "LOG_NOT_FOUND"
	ErrSnapshotInProgress = "SNAPSHOT_IN_PROGRESS"
)

Common Raft error codes

View Source
const (
	// WorkspaceIDKey is the context key for workspace ID
	WorkspaceIDKey contextKey = "workspace_id"
)

Variables

View Source
var ReservedSlugs = []string{
	"admin", "api", "auth", "www", "app", "dashboard",
	"status", "health", "metrics", "mcp", "grpc", "ws",
}

Reserved slugs that cannot be used

Functions

func ContextWithWorkspaceID added in v0.1.0

func ContextWithWorkspaceID(ctx context.Context, workspaceID string) context.Context

ContextWithWorkspaceID returns a context with the workspace ID attached

func GenerateID

func GenerateID() string

GenerateID generates a new ULID string (convenience function).

func IsReservedSlug

func IsReservedSlug(slug string) bool

IsReservedSlug checks if slug is reserved

func SaveConfig

func SaveConfig(path string, config *Config) error

func ValidateSlug

func ValidateSlug(slug string) error

ValidateSlug validates workspace slug

func WorkspaceIDFromContext added in v0.1.0

func WorkspaceIDFromContext(ctx context.Context) string

WorkspaceIDFromContext extracts the workspace ID from a context

Types

type AddVoterRequest

type AddVoterRequest struct {
	ID        string `json:"id"`
	Address   string `json:"address"`
	PrevIndex uint64 `json:"prev_index"`
}

AddVoterRequest adds a voter to the cluster

type AddVoterResponse

type AddVoterResponse struct {
	Index uint64 `json:"index"`
}

AddVoterResponse is the response to an AddVoterRequest

type AlertChannel

type AlertChannel struct {
	ID          string                 `json:"id" yaml:"id"`
	Name        string                 `json:"name" yaml:"name"`
	Type        AlertChannelType       `json:"type" yaml:"type"`
	Enabled     bool                   `json:"enabled" yaml:"enabled"`
	Config      map[string]interface{} `json:"config" yaml:"config"`
	Filters     []AlertFilter          `json:"filters" yaml:"filters"`
	RateLimit   RateLimitConfig        `json:"rate_limit" yaml:"rate_limit"`
	RetryPolicy RetryPolicyConfig      `json:"retry_policy" yaml:"retry_policy"`
	CreatedAt   time.Time              `json:"created_at" yaml:"-"`
	UpdatedAt   time.Time              `json:"updated_at" yaml:"-"`
}

AlertChannel represents a notification destination

func (*AlertChannel) ShouldNotify

func (c *AlertChannel) ShouldNotify(event *AlertEvent) bool

ShouldNotify determines if an alert should be sent based on filters

func (*AlertChannel) Validate

func (c *AlertChannel) Validate() error

Validate checks if the alert channel configuration is valid

type AlertChannelType

type AlertChannelType string

AlertChannelType identifies the notification mechanism

const (
	ChannelEmail     AlertChannelType = "email"
	ChannelSlack     AlertChannelType = "slack"
	ChannelDiscord   AlertChannelType = "discord"
	ChannelTelegram  AlertChannelType = "telegram"
	ChannelPagerDuty AlertChannelType = "pagerduty"
	ChannelOpsGenie  AlertChannelType = "opsgenie"
	ChannelNtfy      AlertChannelType = "ntfy"
	ChannelWebHook   AlertChannelType = "webhook"
	ChannelSMS       AlertChannelType = "sms"
	ChannelMCP       AlertChannelType = "mcp"
)

type AlertCondition

type AlertCondition struct {
	Type      string   `json:"type" yaml:"type"` // consecutive_failures, threshold, percentage, anomaly, compound, status_change, status_for, failure_rate
	Threshold int      `json:"threshold" yaml:"threshold"`
	Metric    string   `json:"metric" yaml:"metric"`
	Operator  string   `json:"operator" yaml:"operator"` // >, <, ==, >=, <=, !=
	Value     any      `json:"value" yaml:"value"`
	Window    Duration `json:"window" yaml:"window"`
	// Additional fields for status-based conditions
	From     string   `json:"from" yaml:"from"`         // for status_change
	To       string   `json:"to" yaml:"to"`             // for status_change
	Status   string   `json:"status" yaml:"status"`     // for status_for
	Duration Duration `json:"duration" yaml:"duration"` // for status_for
}

AlertCondition defines the trigger condition for an alert

type AlertEvent

type AlertEvent struct {
	ID           string            `json:"id"`
	ChannelID    string            `json:"channel_id"`
	ChannelType  AlertChannelType  `json:"channel_type"`
	SoulID       string            `json:"soul_id"`
	SoulName     string            `json:"soul_name"`
	WorkspaceID  string            `json:"workspace_id"`
	Status       SoulStatus        `json:"status"`
	PrevStatus   SoulStatus        `json:"prev_status"`
	Judgment     *Judgment         `json:"judgment"`
	Message      string            `json:"message"`
	Details      map[string]string `json:"details"`
	Severity     Severity          `json:"severity"`
	Timestamp    time.Time         `json:"timestamp"`
	Acknowledged bool              `json:"acknowledged"`
	Resolved     bool              `json:"resolved"`
	AckedAt      *time.Time        `json:"acked_at,omitempty"`
	ResolvedAt   *time.Time        `json:"resolved_at,omitempty"`
}

AlertEvent represents a single alert notification

type AlertFilter

type AlertFilter struct {
	Field    string   `json:"field" yaml:"field"`
	Operator string   `json:"operator" yaml:"operator"`
	Value    string   `json:"value" yaml:"value"`
	Values   []string `json:"values" yaml:"values"`
}

AlertFilter determines when alerts are sent through a channel

func (*AlertFilter) Matches

func (f *AlertFilter) Matches(event *AlertEvent) bool

Matches checks if an event matches the filter

type AlertHistory

type AlertHistory struct {
	Mu      sync.RWMutex
	Entries map[string]*AlertHistoryEntry
}

AlertHistory tracks sent alerts for deduplication and rate limiting

type AlertHistoryEntry

type AlertHistoryEntry struct {
	Key        string     `json:"key"`
	ChannelID  string     `json:"channel_id"`
	Count      int        `json:"count"`
	FirstSent  time.Time  `json:"first_sent"`
	LastSent   time.Time  `json:"last_sent"`
	SoulStatus SoulStatus `json:"soul_status"`
}

AlertHistoryEntry tracks when alerts were sent

type AlertManagerStats

type AlertManagerStats struct {
	TotalAlerts        uint64    `json:"total_alerts"`
	SentAlerts         uint64    `json:"sent_alerts"`
	FailedAlerts       uint64    `json:"failed_alerts"`
	AcknowledgedAlerts uint64    `json:"acknowledged_alerts"`
	ResolvedAlerts     uint64    `json:"resolved_alerts"`
	RateLimitedAlerts  uint64    `json:"rate_limited_alerts"`
	FilteredAlerts     uint64    `json:"filtered_alerts"`
	ActiveIncidents    int       `json:"active_incidents"`
	LastAlertTime      time.Time `json:"last_alert_time"`
}

AlertManagerStats tracks alert system performance

type AlertRule

type AlertRule struct {
	ID          string            `json:"id" yaml:"id"`
	Name        string            `json:"name" yaml:"name"`
	Enabled     bool              `json:"enabled" yaml:"enabled"`
	Scope       RuleScope         `json:"scope" yaml:"scope"`
	Conditions  []AlertCondition  `json:"conditions" yaml:"conditions"`
	Channels    []string          `json:"channels" yaml:"channels"`
	Cooldown    Duration          `json:"cooldown" yaml:"cooldown"`
	AutoResolve bool              `json:"auto_resolve" yaml:"auto_resolve"`
	Escalation  *EscalationPolicy `json:"escalation,omitempty" yaml:"escalation,omitempty"`
	CreatedAt   time.Time         `json:"created_at" yaml:"-"`
}

AlertRule defines when and how to fire a verdict

type AppError

type AppError interface {
	error
	Code() int    // HTTP status code
	Slug() string // Machine-readable error type
}

AppError is the common interface for all application errors

type AppendEntriesRequest

type AppendEntriesRequest struct {
	Term         uint64         `json:"term"`
	LeaderID     string         `json:"leader_id"`
	PrevLogIndex uint64         `json:"prev_log_index"`
	PrevLogTerm  uint64         `json:"prev_log_term"`
	Entries      []RaftLogEntry `json:"entries"`
	LeaderCommit uint64         `json:"leader_commit"`
}

AppendEntriesRequest is sent by the leader to replicate log entries

type AppendEntriesResponse

type AppendEntriesResponse struct {
	Term       uint64 `json:"term"`
	Success    bool   `json:"success"`
	MatchIndex uint64 `json:"match_index"`
	// Used for log inconsistency optimization
	ConflictTerm  uint64 `json:"conflict_term,omitempty"`
	ConflictIndex uint64 `json:"conflict_index,omitempty"`
}

AppendEntriesResponse is the response to an AppendEntries RPC

type ApplyCommandRequest

type ApplyCommandRequest struct {
	Command FSMCommand `json:"command"`
	Timeout Duration   `json:"timeout"`
}

ApplyCommandRequest applies a command through Raft

type ApplyCommandResponse

type ApplyCommandResponse struct {
	Index   uint64 `json:"index"`
	Term    uint64 `json:"term"`
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
	Data    []byte `json:"data,omitempty"`
}

ApplyCommandResponse is the response to an ApplyCommand

type Assertion added in v0.1.0

type Assertion struct {
	Type     string `json:"type" yaml:"type"`                           // status_code, body_contains, json_path, header, response_time, etc.
	Target   string `json:"target,omitempty" yaml:"target,omitempty"`   // JSON path, header name, etc.
	Operator string `json:"operator" yaml:"operator"`                   // equals, not_equals, contains, greater_than, less_than, regex
	Expected string `json:"expected" yaml:"expected"`                   // expected value
	Message  string `json:"message,omitempty" yaml:"message,omitempty"` // custom error message
}

Assertion defines an assertion to verify during a step

type AssertionResult

type AssertionResult struct {
	Type     string `json:"type"` // status_code, body_contains, json_path, etc.
	Expected string `json:"expected"`
	Actual   string `json:"actual"`
	Passed   bool   `json:"passed"`
}

AssertionResult records pass/fail of a specific assertion

type AuthConfig

type AuthConfig struct {
	Enabled bool      `json:"enabled" yaml:"enabled"` // auth enabled/disabled
	Type    string    `json:"type" yaml:"type"`       // local, oidc, ldap
	Local   LocalAuth `json:"local" yaml:"local"`
	OIDC    OIDCAuth  `json:"oidc" yaml:"oidc"`
	LDAP    LDAPAuth  `json:"ldap" yaml:"ldap"`
}

AuthConfig defines authentication settings

type AuthCreds

type AuthCreds struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

AuthCreds holds authentication credentials

type BarrierRequest

type BarrierRequest struct {
	Timeout Duration `json:"timeout"`
}

BarrierRequest creates a barrier for read consistency

type BarrierResponse

type BarrierResponse struct {
	Index   uint64 `json:"index"`
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

BarrierResponse is the response to a BarrierRequest

type CapabilitiesConfig

type CapabilitiesConfig struct {
	ICMP            bool `json:"icmp" yaml:"icmp"`
	IPv6            bool `json:"ipv6" yaml:"ipv6"`
	DNS             bool `json:"dns" yaml:"dns"`
	InternalNetwork bool `json:"internal_network" yaml:"internal_network"`
}

CapabilitiesConfig defines probe capabilities

type ChannelConfig

type ChannelConfig struct {
	Name      string           `json:"name" yaml:"name"`
	Type      string           `json:"type" yaml:"type"` // webhook, slack, discord, telegram, email, pagerduty, opsgenie, sms, ntfy
	Webhook   *WebhookConfig   `json:"webhook,omitempty" yaml:"webhook,omitempty"`
	Slack     *SlackConfig     `json:"slack,omitempty" yaml:"slack,omitempty"`
	Discord   *DiscordConfig   `json:"discord,omitempty" yaml:"discord,omitempty"`
	Telegram  *TelegramConfig  `json:"telegram,omitempty" yaml:"telegram,omitempty"`
	Email     *EmailConfig     `json:"email,omitempty" yaml:"email,omitempty"`
	PagerDuty *PagerDutyConfig `json:"pagerduty,omitempty" yaml:"pagerduty,omitempty"`
	OpsGenie  *OpsGenieConfig  `json:"opsgenie,omitempty" yaml:"opsgenie,omitempty"`
	SMS       *SMSConfig       `json:"sms,omitempty" yaml:"sms,omitempty"`
	Ntfy      *NtfyConfig      `json:"ntfy,omitempty" yaml:"ntfy,omitempty"`
}

ChannelConfig defines an alert notification channel

type CheckType

type CheckType string

CheckType identifies the protocol checker to use

const (
	CheckHTTP      CheckType = "http"
	CheckTCP       CheckType = "tcp"
	CheckUDP       CheckType = "udp"
	CheckDNS       CheckType = "dns"
	CheckSMTP      CheckType = "smtp"
	CheckIMAP      CheckType = "imap"
	CheckICMP      CheckType = "icmp"
	CheckGRPC      CheckType = "grpc"
	CheckWebSocket CheckType = "websocket"
	CheckTLS       CheckType = "tls"
)

type ClusterState

type ClusterState struct {
	NodeID       string         `json:"node_id"`
	State        RaftState      `json:"state"`
	Term         uint64         `json:"term"`
	LastLogIndex uint64         `json:"last_log_index"`
	LastLogTerm  uint64         `json:"last_log_term"`
	CommitIndex  uint64         `json:"commit_index"`
	LastApplied  uint64         `json:"last_applied"`
	LeaderID     string         `json:"leader_id"`
	VotedFor     string         `json:"voted_for"`
	Peers        []RaftPeerInfo `json:"peers"`
	Stats        ClusterStats   `json:"stats"`
	LastContact  time.Time      `json:"last_contact"`
	Uptime       Duration       `json:"uptime"`
}

ClusterState represents the current state of the cluster

type ClusterStats

type ClusterStats struct {
	TotalCommands   uint64 `json:"total_commands"`
	AppliedCommands uint64 `json:"applied_commands"`
	FailedCommands  uint64 `json:"failed_commands"`
	SnapshotsTaken  int    `json:"snapshots_taken"`
	ElectionsWon    uint64 `json:"elections_won"`
	ElectionsLost   uint64 `json:"elections_lost"`
	LeaderChanges   uint64 `json:"leader_changes"`
	HeartbeatCount  uint64 `json:"heartbeat_count"`
}

ClusterStats holds cluster-wide statistics

type CompactionConfig

type CompactionConfig struct {
	RawToMinute  Duration `json:"raw_to_minute" yaml:"raw_to_minute"`
	MinuteToFive Duration `json:"minute_to_five" yaml:"minute_to_five"`
	FiveToHour   Duration `json:"five_to_hour" yaml:"five_to_hour"`
	HourToDay    Duration `json:"hour_to_day" yaml:"hour_to_day"`
}

CompactionConfig defines downsampling thresholds

type Config

type Config struct {
	Server     ServerConfig     `yaml:"server"`
	Storage    StorageConfig    `yaml:"storage"`
	Necropolis NecropolisConfig `yaml:"necropolis"`
	Regions    RegionsConfig    `yaml:"regions"`
	Tenants    TenantsConfig    `yaml:"tenants"`
	Auth       AuthConfig       `yaml:"auth"`
	Dashboard  DashboardConfig  `yaml:"dashboard"`
	Souls      []Soul           `yaml:"souls"`
	Channels   []ChannelConfig  `yaml:"channels"`
	Verdicts   VerdictsConfig   `yaml:"verdicts"`
	Feathers   []FeatherConfig  `yaml:"feathers"`
	Journeys   []JourneyConfig  `yaml:"journeys"`
	Logging    LoggingConfig    `yaml:"logging"`
}

Config is the root configuration for AnubisWatch

func GenerateDefaultConfig

func GenerateDefaultConfig() *Config

GenerateDefaultConfig creates a default configuration file

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig reads and parses the configuration file (YAML or JSON)

type ConfigError

type ConfigError struct {
	Field   string
	Message string
}

ConfigError represents a configuration validation error

func (*ConfigError) Code

func (e *ConfigError) Code() int

func (*ConfigError) Error

func (e *ConfigError) Error() string

func (*ConfigError) Slug

func (e *ConfigError) Slug() string

type ConflictError

type ConflictError struct {
	Message string
}

ConflictError represents a resource conflict

func (*ConflictError) Code

func (e *ConflictError) Code() int

func (*ConflictError) Error

func (e *ConflictError) Error() string

func (*ConflictError) Slug

func (e *ConflictError) Slug() string

type DNSConfig

type DNSConfig struct {
	RecordType           string   `json:"record_type" yaml:"record_type"`
	Expected             []string `json:"expected" yaml:"expected"`
	Nameservers          []string `json:"nameservers" yaml:"nameservers"`
	DNSSECValidate       bool     `json:"dnssec_validate" yaml:"dnssec_validate"`
	PropagationCheck     bool     `json:"propagation_check" yaml:"propagation_check"`
	PropagationThreshold int      `json:"propagation_threshold" yaml:"propagation_threshold"`
}

DNSConfig defines DNS check settings

type DashboardBranding

type DashboardBranding struct {
	Title string `json:"title" yaml:"title"`
	Theme string `json:"theme" yaml:"theme"` // auto, dark, light
}

DashboardBranding defines dashboard customization

type DashboardConfig

type DashboardConfig struct {
	Enabled  bool              `json:"enabled" yaml:"enabled"`
	Branding DashboardBranding `json:"branding" yaml:"branding"`
}

DashboardConfig defines dashboard settings

type DemoteRequest

type DemoteRequest struct {
	NodeID string `json:"node_id"`
}

DemoteRequest demotes a voting node to non-voter

type DemoteResponse

type DemoteResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

DemoteResponse is the response to a DemoteRequest

type DiscordConfig

type DiscordConfig struct {
	WebhookURL string `json:"webhook_url" yaml:"webhook_url"`
	Username   string `json:"username" yaml:"username"`
	AvatarURL  string `json:"avatar_url" yaml:"avatar_url"`
}

DiscordConfig for Discord webhook notifications

type DiscoveryConfig

type DiscoveryConfig struct {
	Mode  string   `json:"mode" yaml:"mode"` // mdns, gossip, manual
	Seeds []string `json:"seeds" yaml:"seeds"`
}

DiscoveryConfig defines node discovery settings

type DiscoveryRequest

type DiscoveryRequest struct {
	NodeID       string           `json:"node_id"`
	Region       string           `json:"region"`
	Address      string           `json:"address"`
	Capabilities NodeCapabilities `json:"capabilities"`
	Version      string           `json:"version"`
}

DiscoveryRequest is sent during service discovery

type DiscoveryResponse

type DiscoveryResponse struct {
	KnownPeers []RaftPeer `json:"known_peers"`
	LeaderID   string     `json:"leader_id,omitempty"`
	ClusterID  string     `json:"cluster_id"`
}

DiscoveryResponse is the response to a DiscoveryRequest

type DistributionConfig

type DistributionConfig struct {
	Strategy          string   `json:"strategy" yaml:"strategy"` // round-robin, region-aware, latency-optimized, redundant
	Redundancy        int      `json:"redundancy" yaml:"redundancy"`
	RebalanceInterval Duration `json:"rebalance_interval" yaml:"rebalance_interval"`
}

DistributionConfig defines check distribution settings

type DistributionPlan

type DistributionPlan struct {
	Version     uint64               `json:"version"`
	Timestamp   time.Time            `json:"timestamp"`
	Strategy    DistributionStrategy `json:"strategy"`
	Assignments []SoulAssignment     `json:"assignments"`
	Revision    uint64               `json:"revision"`
}

DistributionPlan represents the current distribution of souls across the cluster

type DistributionStrategy

type DistributionStrategy string

DistributionStrategy determines how souls are distributed across nodes

const (
	StrategyRoundRobin  DistributionStrategy = "round_robin"
	StrategyRegionAware DistributionStrategy = "region_aware"
	StrategyRedundant   DistributionStrategy = "redundant"
	StrategyWeighted    DistributionStrategy = "weighted"
)

type DistributionUpdateRequest

type DistributionUpdateRequest struct {
	Plan     DistributionPlan `json:"plan"`
	Revision uint64           `json:"revision"`
}

DistributionUpdateRequest updates soul distribution

type DistributionUpdateResponse

type DistributionUpdateResponse struct {
	Success         bool   `json:"success"`
	Accepted        bool   `json:"accepted"` // If false, client should fetch new plan
	CurrentRevision uint64 `json:"current_revision,omitempty"`
	Error           string `json:"error,omitempty"`
}

DistributionUpdateResponse is the response to a DistributionUpdateRequest

type Duration

type Duration struct {
	time.Duration
}

Duration is a YAML-friendly time.Duration

func (Duration) MarshalJSON added in v0.1.0

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Duration

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (interface{}, error)

func (*Duration) UnmarshalJSON added in v0.1.0

func (d *Duration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Duration

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error

type EmailConfig

type EmailConfig struct {
	SMTPHost        string   `json:"smtp_host" yaml:"smtp_host"`
	SMTPPort        int      `json:"smtp_port" yaml:"smtp_port"`
	StartTLS        bool     `json:"starttls" yaml:"starttls"`
	Username        string   `json:"username" yaml:"username"`
	Password        string   `json:"password" yaml:"password"`
	From            string   `json:"from" yaml:"from"`
	To              []string `json:"to" yaml:"to"`
	SubjectTemplate string   `json:"subject_template" yaml:"subject_template"`
}

EmailConfig for SMTP email notifications

type EncryptionConfig

type EncryptionConfig struct {
	Enabled bool   `json:"enabled" yaml:"enabled"`
	Key     string `json:"key" yaml:"key"`
}

EncryptionConfig defines at-rest encryption settings

type EscalationPolicy

type EscalationPolicy struct {
	Name   string            `json:"name" yaml:"name"`
	Stages []EscalationStage `json:"stages" yaml:"stages"`
}

EscalationPolicy defines multi-stage escalation

type EscalationStage

type EscalationStage struct {
	Wait      Duration `json:"wait" yaml:"wait"`
	Channels  []string `json:"channels" yaml:"channels"`
	Condition string   `json:"condition" yaml:"condition"` // not_acknowledged, not_resolved
}

EscalationStage defines a single escalation stage

type ExtractionRule

type ExtractionRule struct {
	From  string `json:"from" yaml:"from"`   // body, header, cookie
	Path  string `json:"path" yaml:"path"`   // JSON path for body, header name for header
	Regex string `json:"regex" yaml:"regex"` // regex to extract (optional)
}

ExtractionRule defines how to extract a variable from a response

type FSMCommand

type FSMCommand struct {
	Op    FSMOp  `json:"op"`
	Table string `json:"table"`
	Key   string `json:"key"`
	Value []byte `json:"value"`
}

FSMCommand represents a command to be applied to the FSM

type FSMOp

type FSMOp uint8

FSMOp represents FSM operation types

const (
	FSMSet FSMOp = iota
	FSMDelete
	FSMDeletePrefix
)

type FeatherConfig

type FeatherConfig struct {
	Name               string       `json:"name" yaml:"name"`
	Scope              string       `json:"scope" yaml:"scope"` // "tag:xxx", "soul:xxx", "type:xxx"
	Rules              FeatherRules `json:"rules" yaml:"rules"`
	Window             Duration     `json:"window" yaml:"window"`                           // evaluation window
	ViolationThreshold int          `json:"violation_threshold" yaml:"violation_threshold"` // consecutive violations
}

FeatherConfig defines a performance budget (Feather of Ma'at)

type FeatherRules

type FeatherRules struct {
	P50 Duration `json:"p50" yaml:"p50"`
	P95 Duration `json:"p95" yaml:"p95"`
	P99 Duration `json:"p99" yaml:"p99"`
	Max Duration `json:"max" yaml:"max"`
}

FeatherRules defines latency thresholds

type FeatureFlags

type FeatureFlags struct {
	StatusPage     bool `json:"status_page" yaml:"status_page"`
	ACME           bool `json:"acme" yaml:"acme"`
	MCP            bool `json:"mcp" yaml:"mcp"`
	AdvancedAlerts bool `json:"advanced_alerts" yaml:"advanced_alerts"`
	SSO            bool `json:"sso" yaml:"sso"`
}

FeatureFlags controls feature availability

type ForbiddenError

type ForbiddenError struct {
	Message string
}

ForbiddenError represents permission denied

func (*ForbiddenError) Code

func (e *ForbiddenError) Code() int

func (*ForbiddenError) Error

func (e *ForbiddenError) Error() string

func (*ForbiddenError) Slug

func (e *ForbiddenError) Slug() string

type GRPCConfig

type GRPCConfig struct {
	Service            string            `json:"service" yaml:"service"`
	TLS                bool              `json:"tls" yaml:"tls"`
	TLSCA              string            `json:"tls_ca" yaml:"tls_ca"`
	InsecureSkipVerify bool              `json:"insecure_skip_verify" yaml:"insecure_skip_verify"`
	Metadata           map[string]string `json:"metadata" yaml:"metadata"`
	Feather            Duration          `json:"feather" yaml:"feather"`
}

GRPCConfig defines gRPC health check settings

type GetConfigurationRequest

type GetConfigurationRequest struct{}

GetConfigurationRequest requests the current cluster configuration

type GetConfigurationResponse

type GetConfigurationResponse struct {
	Index   uint64       `json:"index"`
	Servers []RaftServer `json:"servers"`
}

GetConfigurationResponse returns the cluster configuration

type GetDistributionRequest

type GetDistributionRequest struct{}

GetDistributionRequest requests the current distribution plan

type GetDistributionResponse

type GetDistributionResponse struct {
	Plan DistributionPlan `json:"plan"`
}

GetDistributionResponse returns the current distribution plan

type GroupStatusInfo

type GroupStatusInfo struct {
	ID          string           `json:"id"`
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Souls       []SoulStatusInfo `json:"souls"`
}

GroupStatusInfo is group info for status page

type HTTPConfig

type HTTPConfig struct {
	Method             string            `json:"method" yaml:"method"`
	Headers            map[string]string `json:"headers" yaml:"headers"`
	Body               string            `json:"body" yaml:"body"`
	ValidStatus        []int             `json:"valid_status" yaml:"valid_status"`
	BodyContains       string            `json:"body_contains" yaml:"body_contains"`
	BodyRegex          string            `json:"body_regex" yaml:"body_regex"`
	JSONPath           map[string]string `json:"json_path" yaml:"json_path"`
	JSONSchema         string            `json:"json_schema" yaml:"json_schema"`
	JSONSchemaStrict   bool              `json:"json_schema_strict" yaml:"json_schema_strict"`
	ResponseHeaders    map[string]string `json:"response_headers" yaml:"response_headers"`
	Feather            Duration          `json:"feather" yaml:"feather"` // Performance budget
	FollowRedirects    bool              `json:"follow_redirects" yaml:"follow_redirects"`
	MaxRedirects       int               `json:"max_redirects" yaml:"max_redirects"`
	InsecureSkipVerify bool              `json:"insecure_skip_verify" yaml:"insecure_skip_verify"`
}

HTTPConfig defines HTTP/HTTPS check settings

type HealthCheckConfig added in v0.1.0

type HealthCheckConfig struct {
	Enabled          bool              `json:"enabled" yaml:"enabled"`
	Interval         Duration          `json:"interval" yaml:"interval"`
	Timeout          Duration          `json:"timeout" yaml:"timeout"`
	FailureThreshold int               `json:"failure_threshold" yaml:"failure_threshold"`
	SuccessThreshold int               `json:"success_threshold" yaml:"success_threshold"`
	Endpoints        map[string]string `json:"endpoints" yaml:"endpoints"`
}

HealthCheckConfig defines region health monitoring settings

type HeartbeatRequest

type HeartbeatRequest struct {
	NodeID    string `json:"node_id"`
	LeaderID  string `json:"leader_id"`
	Term      uint64 `json:"term"`
	Timestamp int64  `json:"timestamp"`
}

HeartbeatRequest is a lightweight heartbeat for health checks

type HeartbeatResponse

type HeartbeatResponse struct {
	NodeID    string `json:"node_id"`
	Term      uint64 `json:"term"`
	IsLeader  bool   `json:"is_leader"`
	LeaderID  string `json:"leader_id"`
	Timestamp int64  `json:"timestamp"`
}

HeartbeatResponse is the response to a HeartbeatRequest

type ICMPConfig

type ICMPConfig struct {
	Count          int      `json:"count" yaml:"count"`
	Interval       Duration `json:"interval" yaml:"interval"`
	MaxLossPercent float64  `json:"max_loss_percent" yaml:"max_loss_percent"`
	Feather        Duration `json:"feather" yaml:"feather"`
	IPv6           bool     `json:"ipv6" yaml:"ipv6"`
	Privileged     bool     `json:"privileged" yaml:"privileged"`
}

ICMPConfig defines ICMP ping check settings

type IMAPConfig

type IMAPConfig struct {
	TLS                bool       `json:"tls" yaml:"tls"`
	Auth               *AuthCreds `json:"auth,omitempty" yaml:"auth,omitempty"`
	CheckMailbox       string     `json:"check_mailbox" yaml:"check_mailbox"`
	InsecureSkipVerify bool       `json:"insecure_skip_verify" yaml:"insecure_skip_verify"`
}

IMAPConfig defines IMAP check settings

type Incident

type Incident struct {
	ID              string         `json:"id"`
	RuleID          string         `json:"rule_id"`
	SoulID          string         `json:"soul_id"`
	WorkspaceID     string         `json:"workspace_id"`
	Status          IncidentStatus `json:"status"`
	Severity        Severity       `json:"severity"`
	StartedAt       time.Time      `json:"started_at"`
	AckedAt         *time.Time     `json:"acked_at,omitempty"`
	ResolvedAt      *time.Time     `json:"resolved_at,omitempty"`
	AckedBy         string         `json:"acked_by,omitempty"`
	ResolvedBy      string         `json:"resolved_by,omitempty"`
	Notes           []IncidentNote `json:"notes"`
	Events          []AlertEvent   `json:"events"`
	EscalationLevel int            `json:"escalation_level"`
	LastEscalatedAt *time.Time     `json:"last_escalated_at,omitempty"`
}

Incident represents an active or resolved alert incident

type IncidentNote

type IncidentNote struct {
	Author    string    `json:"author"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

IncidentNote is a user annotation on an incident

type IncidentStatus

type IncidentStatus string

IncidentStatus represents incident status for status pages and alert incidents

const (
	IncidentOpen     IncidentStatus = "open"
	IncidentAcked    IncidentStatus = "acknowledged"
	IncidentResolved IncidentStatus = "resolved"
	// Legacy aliases for status page compatibility
	StatusOngoing       IncidentStatus = "ongoing"
	StatusInvestigating IncidentStatus = "investigating"
	StatusIdentified    IncidentStatus = "identified"
	StatusMonitoring    IncidentStatus = "monitoring"
	StatusResolved      IncidentStatus = "resolved"
)

type IncidentUpdate

type IncidentUpdate struct {
	ID        string    `json:"id"`
	Message   string    `json:"message"`
	Status    string    `json:"status"`
	UpdatedAt time.Time `json:"updated_at"`
}

IncidentUpdate is a status update for an incident

type InstallSnapshotRequest

type InstallSnapshotRequest struct {
	Term              uint64 `json:"term"`
	LeaderID          string `json:"leader_id"`
	LastIncludedIndex uint64 `json:"last_included_index"`
	LastIncludedTerm  uint64 `json:"last_included_term"`
	Offset            uint64 `json:"offset"`
	Data              []byte `json:"data"`
	Done              bool   `json:"done"`
}

InstallSnapshotRequest is sent by the leader to transfer a snapshot

type InstallSnapshotResponse

type InstallSnapshotResponse struct {
	Term    uint64 `json:"term"`
	Success bool   `json:"success"`
}

InstallSnapshotResponse is the response to an InstallSnapshot RPC

type InternalError

type InternalError struct {
	Message string
	Cause   error
}

InternalError represents an unexpected internal error

func (*InternalError) Code

func (e *InternalError) Code() int

func (*InternalError) Error

func (e *InternalError) Error() string

func (*InternalError) Slug

func (e *InternalError) Slug() string

type JoinRequest

type JoinRequest struct {
	NodeID                 string           `json:"node_id"`
	Address                string           `json:"address"`
	Region                 string           `json:"region"`
	Role                   RaftRole         `json:"role"`
	Capabilities           NodeCapabilities `json:"capabilities"`
	Version                string           `json:"version"`
	PrevConfigurationIndex uint64           `json:"prev_configuration_index"`
}

JoinRequest is sent by a node wanting to join the cluster

type JoinResponse

type JoinResponse struct {
	Success       bool       `json:"success"`
	LeaderID      string     `json:"leader_id,omitempty"`
	LeaderAddress string     `json:"leader_address,omitempty"`
	Peers         []RaftPeer `json:"peers,omitempty"`
	Error         string     `json:"error,omitempty"`
	Term          uint64     `json:"term"`
}

JoinResponse is the response to a JoinRequest

type JourneyConfig

type JourneyConfig struct {
	Name              string            `json:"name" yaml:"name"`
	ID                string            `json:"id" yaml:"id"`
	WorkspaceID       string            `json:"workspace_id" yaml:"-"`
	Weight            Duration          `json:"weight" yaml:"weight"`   // check interval
	Timeout           Duration          `json:"timeout" yaml:"timeout"` // total journey timeout
	ContinueOnFailure bool              `json:"continue_on_failure" yaml:"continue_on_failure"`
	Variables         map[string]string `json:"variables" yaml:"variables"` // default variables
	Steps             []JourneyStep     `json:"steps" yaml:"steps"`
	Enabled           bool              `json:"enabled" yaml:"enabled"`
	CreatedAt         time.Time         `json:"created_at" yaml:"-"`
	UpdatedAt         time.Time         `json:"updated_at" yaml:"-"`
}

JourneyConfig defines a multi-step synthetic check (Duat Journey)

type JourneyRun

type JourneyRun struct {
	ID          string              `json:"id"`
	JourneyID   string              `json:"journey_id"`
	WorkspaceID string              `json:"workspace_id"`
	JackalID    string              `json:"jackal_id"`
	Region      string              `json:"region"`
	StartedAt   int64               `json:"started_at"` // Unix timestamp (ms)
	CompletedAt int64               `json:"completed_at"`
	Duration    int64               `json:"duration"` // Total duration in ms
	Status      SoulStatus          `json:"status"`
	Steps       []JourneyStepResult `json:"steps"`
	Variables   map[string]string   `json:"variables"` // Captured variables
}

JourneyRun represents the result of executing a journey

type JourneyStep

type JourneyStep struct {
	Name       string                    `json:"name" yaml:"name"`
	Type       CheckType                 `json:"type" yaml:"type"`     // http, tcp, udp, dns, etc.
	Target     string                    `json:"target" yaml:"target"` // can use ${variable}
	Timeout    Duration                  `json:"timeout" yaml:"timeout"`
	HTTP       *HTTPConfig               `json:"http,omitempty" yaml:"http,omitempty"`
	TCP        *TCPConfig                `json:"tcp,omitempty" yaml:"tcp,omitempty"`
	UDP        *UDPConfig                `json:"udp,omitempty" yaml:"udp,omitempty"`
	DNS        *DNSConfig                `json:"dns,omitempty" yaml:"dns,omitempty"`
	TLS        *TLSConfig                `json:"tls,omitempty" yaml:"tls,omitempty"`
	Extract    map[string]ExtractionRule `json:"extract" yaml:"extract"`
	Assertions []Assertion               `json:"assertions,omitempty" yaml:"assertions,omitempty"`
}

JourneyStep represents a single step in a journey

type JourneyStepResult

type JourneyStepResult struct {
	Name      string            `json:"name"`
	StepIndex int               `json:"step_index"`
	Status    SoulStatus        `json:"status"`
	Duration  int64             `json:"duration"` // ms
	Message   string            `json:"message"`
	Extracted map[string]string `json:"extracted,omitempty"` // Variables extracted from this step
}

JourneyStepResult represents the result of a single step

type Judgment

type Judgment struct {
	ID          string           `json:"id"`
	SoulID      string           `json:"soul_id"`
	WorkspaceID string           `json:"workspace_id"` // for routing WebSocket broadcasts
	JackalID    string           `json:"jackal_id"`    // which probe node
	Region      string           `json:"region"`
	Timestamp   time.Time        `json:"timestamp"`
	Duration    time.Duration    `json:"duration"` // check latency
	Status      SoulStatus       `json:"status"`
	StatusCode  int              `json:"status_code"` // protocol-specific
	Message     string           `json:"message"`
	Details     *JudgmentDetails `json:"details,omitempty"`
	TLSInfo     *TLSInfo         `json:"tls_info,omitempty"`
}

Judgment is the result of weighing a soul — a single check execution.

type JudgmentDetails

type JudgmentDetails struct {
	// HTTP
	ResponseHeaders map[string]string `json:"response_headers,omitempty"`
	ResponseBody    string            `json:"response_body,omitempty"`
	RedirectChain   []string          `json:"redirect_chain,omitempty"`

	// DNS
	ResolvedAddresses []string        `json:"resolved_addresses,omitempty"`
	DNSSECValid       *bool           `json:"dnssec_valid,omitempty"`
	PropagationResult map[string]bool `json:"propagation_result,omitempty"`

	// ICMP
	PacketsSent     int     `json:"packets_sent,omitempty"`
	PacketsReceived int     `json:"packets_received,omitempty"`
	PacketLoss      float64 `json:"packet_loss,omitempty"`
	MinLatency      float64 `json:"min_latency_ms,omitempty"`
	AvgLatency      float64 `json:"avg_latency_ms,omitempty"`
	MaxLatency      float64 `json:"max_latency_ms,omitempty"`
	Jitter          float64 `json:"jitter_ms,omitempty"`

	// TCP
	Banner string `json:"banner,omitempty"`

	// SMTP/IMAP
	Capabilities []string `json:"capabilities,omitempty"`

	// gRPC
	ServiceStatus string `json:"service_status,omitempty"`

	// WebSocket
	CloseCode int `json:"close_code,omitempty"`

	// Assertions
	Assertions []AssertionResult `json:"assertions,omitempty"`
}

JudgmentDetails holds protocol-specific result data

type LDAPAuth

type LDAPAuth struct {
	URL          string `json:"url" yaml:"url"`
	BindDN       string `json:"bind_dn" yaml:"bind_dn"`
	BindPassword string `json:"bind_password" yaml:"bind_password"`
	BaseDN       string `json:"base_dn" yaml:"base_dn"`
	UserFilter   string `json:"user_filter" yaml:"user_filter"`
}

LDAPAuth defines LDAP settings

type LeadershipTransferRequest

type LeadershipTransferRequest struct {
	TargetServerID string `json:"target_server_id,omitempty"`
}

LeadershipTransferRequest requests a leadership transfer

type LeadershipTransferResponse

type LeadershipTransferResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

LeadershipTransferResponse is the response to a LeadershipTransferRequest

type LeaveRequest

type LeaveRequest struct {
	NodeID string `json:"node_id"`
	Force  bool   `json:"force"` // Force removal even if not graceful
}

LeaveRequest is sent by a node leaving the cluster

type LeaveResponse

type LeaveResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

LeaveResponse is the response to a LeaveRequest

type LocalAuth

type LocalAuth struct {
	AdminEmail    string `json:"admin_email" yaml:"admin_email"`
	AdminPassword string `json:"admin_password" yaml:"admin_password"`
}

LocalAuth defines local authentication

type LogEntryType

type LogEntryType uint8

LogEntryType distinguishes different types of log entries

const (
	LogCommand LogEntryType = iota
	LogNoOp
	LogConfiguration
	LogMembershipChange // Joint consensus membership change
)

func (LogEntryType) String

func (t LogEntryType) String() string

type LoggingConfig

type LoggingConfig struct {
	Level  string `json:"level" yaml:"level"`   // debug, info, warn, error
	Format string `json:"format" yaml:"format"` // json, text
	Output string `json:"output" yaml:"output"` // stdout, file
	File   string `json:"file" yaml:"file"`     // log file path (if output=file)
}

LoggingConfig defines logging settings

type Member

type Member struct {
	ID          string     `json:"id"`
	WorkspaceID string     `json:"workspace_id"`
	UserID      string     `json:"user_id"`
	Role        MemberRole `json:"role"`
	JoinedAt    time.Time  `json:"joined_at"`
	LastActive  time.Time  `json:"last_active"`
}

Member represents a workspace member

type MemberRole

type MemberRole string

MemberRole defines permission levels

const (
	RoleOwner  MemberRole = "owner"  // Full access
	RoleAdmin  MemberRole = "admin"  // Manage souls, channels, members
	RoleEditor MemberRole = "editor" // Manage souls only
	RoleViewer MemberRole = "viewer" // Read-only access
	RoleAPI    MemberRole = "api"    // API-only access
)

func (MemberRole) Can

func (r MemberRole) Can(permission string) bool

Can checks if role has permission

type MembershipChange added in v0.1.0

type MembershipChange struct {
	Type    MembershipChangeType `json:"type"`
	Peer    RaftPeer             `json:"peer"`
	OldPeer *RaftPeer            `json:"old_peer,omitempty"` // For replace operations
	// Joint consensus tracking
	OldConfig []string `json:"old_config"` // Node IDs in old configuration
	NewConfig []string `json:"new_config"` // Node IDs in new configuration
	Phase     string   `json:"phase"`      // "joint" or "final"
}

MembershipChange represents a joint consensus membership change entry This enables safe cluster membership changes using the Raft joint consensus protocol

type MembershipChangeType added in v0.1.0

type MembershipChangeType uint8

MembershipChangeType represents the type of membership change

const (
	MembershipAddPeer MembershipChangeType = iota
	MembershipRemovePeer
	MembershipReplacePeer
)

type NecropolisConfig

type NecropolisConfig struct {
	Enabled       bool               `json:"enabled" yaml:"enabled"`
	NodeName      string             `json:"node_name" yaml:"node_name"`
	Region        string             `json:"region" yaml:"region"`
	Tags          map[string]string  `json:"tags" yaml:"tags"`
	BindAddr      string             `json:"bind_addr" yaml:"bind_addr"`
	AdvertiseAddr string             `json:"advertise_addr" yaml:"advertise_addr"`
	ClusterSecret string             `json:"cluster_secret" yaml:"cluster_secret"`
	Discovery     DiscoveryConfig    `json:"discovery" yaml:"discovery"`
	Raft          RaftConfig         `json:"raft" yaml:"raft"`
	Distribution  DistributionConfig `json:"distribution" yaml:"distribution"`
	Capabilities  CapabilitiesConfig `json:"capabilities" yaml:"capabilities"`
}

NecropolisConfig defines cluster settings

type NodeCapabilities

type NodeCapabilities struct {
	CanProbe     bool `json:"can_probe"`
	CanStore     bool `json:"can_store"`
	CanAlert     bool `json:"can_alert"`
	CanCompute   bool `json:"can_compute"`
	MaxSouls     int  `json:"max_souls"`
	MaxCheckRate int  `json:"max_check_rate"`
}

NodeCapabilities describes what a node can do

type NodeHealthReport

type NodeHealthReport struct {
	NodeID       string  `json:"node_id"`
	Timestamp    int64   `json:"timestamp"`
	LoadAvg      float64 `json:"load_avg"`
	MemoryUsage  float64 `json:"memory_usage"`
	DiskUsage    float64 `json:"disk_usage"`
	ActiveSouls  int     `json:"active_souls"`
	CheckRate    float64 `json:"check_rate"` // actual checks/sec
	FailedChecks int     `json:"failed_checks"`
	Region       string  `json:"region"`
}

NodeHealthReport is sent periodically by nodes to report health

type NodeInfo

type NodeInfo struct {
	ID            string            `json:"id"`
	Region        string            `json:"region"`
	Address       string            `json:"address"`
	Version       string            `json:"version"`
	State         RaftState         `json:"state"`
	Role          RaftRole          `json:"role"`
	Capabilities  NodeCapabilities  `json:"capabilities"`
	AssignedSouls int               `json:"assigned_souls"`
	ActiveChecks  int               `json:"active_checks"`
	LoadAvg       float64           `json:"load_avg"`
	MemoryUsage   float64           `json:"memory_usage"`
	DiskUsage     float64           `json:"disk_usage"`
	LastHeartbeat time.Time         `json:"last_heartbeat"`
	StartTime     time.Time         `json:"start_time"`
	Tags          map[string]string `json:"tags"`
	CanProbe      bool              `json:"can_probe"`
	MaxSouls      int               `json:"max_souls"`
}

NodeInfo represents runtime node information

type NotFoundError

type NotFoundError struct {
	Entity string
	ID     string
}

NotFoundError represents a missing resource error

func (*NotFoundError) Code

func (e *NotFoundError) Code() int

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Slug

func (e *NotFoundError) Slug() string

type NotificationPrefs

type NotificationPrefs struct {
	DigestEnabled    bool     `json:"digest_enabled" yaml:"digest_enabled"`
	DigestFrequency  string   `json:"digest_frequency" yaml:"digest_frequency"` // hourly, daily, weekly
	AlertThreshold   int      `json:"alert_threshold" yaml:"alert_threshold"`   // min severity level
	ExcludedChannels []string `json:"excluded_channels" yaml:"excluded_channels"`
}

NotificationPrefs contains notification preferences

type NotificationResult

type NotificationResult struct {
	Success   bool          `json:"success"`
	Error     string        `json:"error,omitempty"`
	ChannelID string        `json:"channel_id"`
	Timestamp time.Time     `json:"timestamp"`
	Duration  time.Duration `json:"duration"`
	Attempt   int           `json:"attempt"`
}

NotificationResult tracks delivery status

type NtfyConfig

type NtfyConfig struct {
	Server      string            `json:"server" yaml:"server"`
	Topic       string            `json:"topic" yaml:"topic"`
	PriorityMap map[string]string `json:"priority_map" yaml:"priority_map"`
	Auth        struct {
		Username string `json:"username" yaml:"username"`
		Password string `json:"password" yaml:"password"`
	} `json:"auth" yaml:"auth"`
}

NtfyConfig for Ntfy.sh notifications

type OIDCAuth

type OIDCAuth struct {
	Issuer       string `json:"issuer" yaml:"issuer"`
	ClientID     string `json:"client_id" yaml:"client_id"`
	ClientSecret string `json:"client_secret" yaml:"client_secret"`
	RedirectURL  string `json:"redirect_url" yaml:"redirect_url"`
}

OIDCAuth defines OIDC settings

type OpsGenieConfig

type OpsGenieConfig struct {
	APIKey      string            `json:"api_key" yaml:"api_key"`
	PriorityMap map[string]string `json:"priority_map" yaml:"priority_map"`
	Tags        []string          `json:"tags" yaml:"tags"`
	AutoClose   bool              `json:"auto_close" yaml:"auto_close"`
}

OpsGenieConfig for OpsGenie integration

type OverallStatus

type OverallStatus struct {
	Status      string    `json:"status"` // operational, degraded, major_outage
	Title       string    `json:"title"`
	Description string    `json:"description"`
	UpdatedAt   time.Time `json:"updated_at"`
}

OverallStatus represents the overall system status

func CalculateOverallStatus

func CalculateOverallStatus(souls []SoulStatusInfo) OverallStatus

CalculateOverallStatus determines overall status from souls

type PageVisibility

type PageVisibility string

PageVisibility controls who can see the page

const (
	VisibilityPublic    PageVisibility = "public"    // Anyone can see
	VisibilityPrivate   PageVisibility = "private"   // Authentication required
	VisibilityProtected PageVisibility = "protected" // Password protected
)

type PagerDutyConfig

type PagerDutyConfig struct {
	IntegrationKey string            `json:"integration_key" yaml:"integration_key"`
	SeverityMap    map[string]string `json:"severity_map" yaml:"severity_map"`
	AutoResolve    bool              `json:"auto_resolve" yaml:"auto_resolve"`
}

PagerDutyConfig for PagerDuty integration

type PeerInfoRequest

type PeerInfoRequest struct {
	NodeID string `json:"node_id"`
}

PeerInfoRequest requests information about a peer

type PeerInfoResponse

type PeerInfoResponse struct {
	Info         RaftPeerInfo `json:"info"`
	ClusterState ClusterState `json:"cluster_state"`
}

PeerInfoResponse returns peer information

type PreVoteRequest added in v0.0.2

type PreVoteRequest struct {
	Term         uint64 `json:"term"`
	CandidateID  string `json:"candidate_id"`
	LastLogIndex uint64 `json:"last_log_index"`
	LastLogTerm  uint64 `json:"last_log_term"`
}

PreVoteRequest is sent by candidates to check if they would win an election This prevents disruptive elections from candidates with stale logs

type PreVoteResponse added in v0.0.2

type PreVoteResponse struct {
	Term        uint64 `json:"term"`
	VoteGranted bool   `json:"vote_granted"`
	Reason      string `json:"reason,omitempty"`
}

PreVoteResponse is the response to a PreVote RPC

type ProbeStatus

type ProbeStatus struct {
	Running         bool     `json:"running"`
	ActiveChecks    int      `json:"active_checks"`
	ChecksRunning   int      `json:"checks_running"`
	ChecksPerSecond float64  `json:"checks_per_second"`
	AvgLatency      Duration `json:"avg_latency"`
	FailedChecks    int64    `json:"failed_checks"`
	TotalChecks     int64    `json:"total_checks"`
	NodeID          string   `json:"node_id,omitempty"`
	Region          string   `json:"region,omitempty"`
}

ProbeStatus represents the probe engine status

type PromoteRequest

type PromoteRequest struct {
	NodeID string `json:"node_id"`
}

PromoteRequest promotes a non-voting node to voter

type PromoteResponse

type PromoteResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

PromoteResponse is the response to a PromoteRequest

type QuotaConfig

type QuotaConfig struct {
	MaxSouls         int      `json:"max_souls" yaml:"max_souls"`
	MaxJourneys      int      `json:"max_journeys" yaml:"max_journeys"`
	MaxAlertChannels int      `json:"max_alert_channels" yaml:"max_alert_channels"`
	MaxTeamMembers   int      `json:"max_team_members" yaml:"max_team_members"`
	RetentionDays    int      `json:"retention_days" yaml:"retention_days"`
	CheckIntervalMin Duration `json:"check_interval_min" yaml:"check_interval_min"`
}

QuotaConfig defines resource limits

type QuotaUsage

type QuotaUsage struct {
	Souls         int       `json:"souls"`
	Channels      int       `json:"channels"`
	Rules         int       `json:"rules"`
	Members       int       `json:"members"`
	ChecksPerHour int       `json:"checks_per_hour"`
	StorageBytes  int64     `json:"storage_bytes"`
	LastUpdated   time.Time `json:"last_updated"`
}

QuotaUsage tracks current quota consumption

func (*QuotaUsage) IsQuotaExceeded

func (q *QuotaUsage) IsQuotaExceeded(config QuotaConfig) (string, bool)

IsQuotaExceeded checks if quota is exceeded

type RaftConfig

type RaftConfig struct {
	NodeID            string         `json:"node_id" yaml:"node_id"`
	BindAddr          string         `json:"bind_addr" yaml:"bind_addr"`
	AdvertiseAddr     string         `json:"advertise_addr" yaml:"advertise_addr"`
	Region            string         `json:"region" yaml:"region"`
	Bootstrap         bool           `json:"bootstrap" yaml:"bootstrap"`
	ElectionTimeout   Duration       `json:"election_timeout" yaml:"election_timeout"`
	HeartbeatTimeout  Duration       `json:"heartbeat_timeout" yaml:"heartbeat_timeout"`
	CommitTimeout     Duration       `json:"commit_timeout" yaml:"commit_timeout"`
	SnapshotInterval  Duration       `json:"snapshot_interval" yaml:"snapshot_interval"`
	SnapshotThreshold int            `json:"snapshot_threshold" yaml:"snapshot_threshold"`
	MaxAppendEntries  int            `json:"max_append_entries" yaml:"max_append_entries"`
	TrailingLogs      int            `json:"trailing_logs" yaml:"trailing_logs"`
	Peers             []RaftPeer     `json:"peers" yaml:"peers"`
	TLS               *TLSPeerConfig `json:"tls" yaml:"tls"`
	Role              RaftRole       `json:"role" yaml:"role"`
}

RaftConfig defines Raft consensus settings

func (*RaftConfig) Validate

func (c *RaftConfig) Validate() error

Validate validates the Raft configuration

type RaftError

type RaftError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	NodeID  string `json:"node_id,omitempty"`
}

RaftError represents Raft-specific errors

func (*RaftError) Error

func (e *RaftError) Error() string

type RaftLogEntry

type RaftLogEntry struct {
	Index uint64       `json:"index"`
	Term  uint64       `json:"term"`
	Type  LogEntryType `json:"type"`
	Data  []byte       `json:"data"`
}

RaftLogEntry represents a single entry in the Raft log

type RaftPeer

type RaftPeer struct {
	ID       string   `json:"id" yaml:"id"`
	Address  string   `json:"address" yaml:"address"`
	Region   string   `json:"region" yaml:"region"`
	Role     RaftRole `json:"role" yaml:"role"`
	NonVoter bool     `json:"non_voter" yaml:"non_voter"`
}

RaftPeer represents a peer node in the cluster

type RaftPeerInfo

type RaftPeerInfo struct {
	RaftPeer
	IsConnected  bool      `json:"is_connected"`
	LastContact  time.Time `json:"last_contact"`
	NextIndex    uint64    `json:"next_index"`
	MatchIndex   uint64    `json:"match_index"`
	Inflight     uint64    `json:"inflight"`
	HeartbeatRTT Duration  `json:"heartbeat_rtt"`
}

RaftPeerInfo extends RaftPeer with runtime information

type RaftRole

type RaftRole string

RaftRole represents additional cluster roles

const (
	RoleVoter    RaftRole = "voter"    // Full voting member
	RoleNonVoter RaftRole = "nonvoter" // Observer, no voting rights
	RoleSpare    RaftRole = "spare"    // Standby, can be promoted
)

type RaftServer

type RaftServer struct {
	ID       string   `json:"id"`
	Address  string   `json:"address"`
	Suffrage RaftRole `json:"suffrage"` // voter or nonvoter
	Region   string   `json:"region"`
}

RaftServer represents a server in the configuration

type RaftState

type RaftState string

RaftState represents the state of a Raft node

const (
	StateFollower  RaftState = "follower"
	StateCandidate RaftState = "candidate"
	StateLeader    RaftState = "leader"
)

func (RaftState) IsCandidate

func (s RaftState) IsCandidate() bool

IsCandidate returns true if the state is Candidate

func (RaftState) IsFollower

func (s RaftState) IsFollower() bool

IsFollower returns true if the state is Follower

func (RaftState) IsLeader

func (s RaftState) IsLeader() bool

IsLeader returns true if the state is Leader

func (RaftState) String

func (s RaftState) String() string

String returns the string representation of the state

type RateLimitConfig

type RateLimitConfig struct {
	Enabled     bool     `json:"enabled" yaml:"enabled"`
	MaxAlerts   int      `json:"max_alerts" yaml:"max_alerts"`
	Window      Duration `json:"window" yaml:"window"`
	GroupingKey string   `json:"grouping_key" yaml:"grouping_key"`
}

RateLimitConfig controls alert flooding

type RegionsConfig added in v0.1.0

type RegionsConfig struct {
	Enabled       bool                 `json:"enabled" yaml:"enabled"`
	LocalRegion   string               `json:"local_region" yaml:"local_region"`
	Replication   ReplicationConfig    `json:"replication" yaml:"replication"`
	Routing       RoutingConfig        `json:"routing" yaml:"routing"`
	HealthCheck   HealthCheckConfig    `json:"health_check" yaml:"health_check"`
	RemoteRegions []RemoteRegionConfig `json:"remote_regions" yaml:"remote_regions"`
}

RegionsConfig defines multi-region configuration

type RemoteRegionConfig added in v0.1.0

type RemoteRegionConfig struct {
	ID        string  `json:"id" yaml:"id"`
	Name      string  `json:"name" yaml:"name"`
	Endpoint  string  `json:"endpoint" yaml:"endpoint"`
	Location  string  `json:"location" yaml:"location"`
	Latitude  float64 `json:"latitude" yaml:"latitude"`
	Longitude float64 `json:"longitude" yaml:"longitude"`
	Priority  int     `json:"priority" yaml:"priority"`
	Enabled   bool    `json:"enabled" yaml:"enabled"`
	Secret    string  `json:"secret" yaml:"secret"`
}

RemoteRegionConfig defines a remote region

type RemoveServerRequest

type RemoveServerRequest struct {
	ID        string `json:"id"`
	PrevIndex uint64 `json:"prev_index"`
}

RemoveServerRequest removes a server from the cluster

type RemoveServerResponse

type RemoveServerResponse struct {
	Index uint64 `json:"index"`
}

RemoveServerResponse is the response to a RemoveServerRequest

type ReplicationConfig added in v0.1.0

type ReplicationConfig struct {
	Enabled          bool     `json:"enabled" yaml:"enabled"`
	SyncMode         string   `json:"sync_mode" yaml:"sync_mode"`
	BatchSize        int      `json:"batch_size" yaml:"batch_size"`
	BatchInterval    Duration `json:"batch_interval" yaml:"batch_interval"`
	ConflictStrategy string   `json:"conflict_strategy" yaml:"conflict_strategy"`
	RetryInterval    Duration `json:"retry_interval" yaml:"retry_interval"`
	MaxRetries       int      `json:"max_retries" yaml:"max_retries"`
	Compression      bool     `json:"compression" yaml:"compression"`
	EncryptTraffic   bool     `json:"encrypt_traffic" yaml:"encrypt_traffic"`
}

ReplicationConfig defines cross-region replication settings

type RequestVoteRequest

type RequestVoteRequest struct {
	Term         uint64 `json:"term"`
	CandidateID  string `json:"candidate_id"`
	LastLogIndex uint64 `json:"last_log_index"`
	LastLogTerm  uint64 `json:"last_log_term"`
	// Pre-vote extension: carry over pre-vote term
	PreVoteTerm uint64 `json:"pre_vote_term,omitempty"`
}

RequestVoteRequest is sent by candidates to gather votes

type RequestVoteResponse

type RequestVoteResponse struct {
	Term        uint64 `json:"term"`
	VoteGranted bool   `json:"vote_granted"`
	Reason      string `json:"reason,omitempty"`
}

RequestVoteResponse is the response to a RequestVote RPC

type RetentionConfig

type RetentionConfig struct {
	Raw     Duration `json:"raw" yaml:"raw"`
	Minute  Duration `json:"minute" yaml:"minute"`
	FiveMin Duration `json:"five" yaml:"five"`
	Hour    Duration `json:"hour" yaml:"hour"`
	Day     string   `json:"day" yaml:"day"` // "unlimited" or duration
}

RetentionConfig defines data retention periods

type RetryPolicyConfig

type RetryPolicyConfig struct {
	MaxRetries  int      `json:"max_retries" yaml:"max_retries"`
	InitialWait Duration `json:"initial_wait" yaml:"initial_wait"`
	MaxWait     Duration `json:"max_wait" yaml:"max_wait"`
	Backoff     string   `json:"backoff" yaml:"backoff"`
}

RetryPolicyConfig controls failed delivery retries

type RoutingConfig added in v0.1.0

type RoutingConfig struct {
	Enabled         bool     `json:"enabled" yaml:"enabled"`
	LatencyBased    bool     `json:"latency_based" yaml:"latency_based"`
	GeoBased        bool     `json:"geo_based" yaml:"geo_based"`
	HealthBased     bool     `json:"health_based" yaml:"health_based"`
	FailoverTimeout Duration `json:"failover_timeout" yaml:"failover_timeout"`
}

RoutingConfig defines region-aware routing settings

type RuleScope

type RuleScope struct {
	Type       string   `json:"type" yaml:"type"` // all, tag, type, specific
	Tags       []string `json:"tags" yaml:"tags"`
	SoulTypes  []string `json:"soul_types" yaml:"soul_types"`
	SoulIDs    []string `json:"soul_ids" yaml:"soul_ids"`
	Workspaces []string `json:"workspaces" yaml:"workspaces"`
}

RuleScope defines what souls the rule applies to

type SMSConfig

type SMSConfig struct {
	Provider   string   `json:"provider" yaml:"provider"` // twilio, vonage
	AccountSID string   `json:"account_sid" yaml:"account_sid"`
	AuthToken  string   `json:"auth_token" yaml:"auth_token"`
	From       string   `json:"from" yaml:"from"`
	To         []string `json:"to" yaml:"to"`
	Template   string   `json:"template" yaml:"template"`
}

SMSConfig for SMS notifications via Twilio/Vonage

type SMTPConfig

type SMTPConfig struct {
	EHLODomain         string     `json:"ehlo_domain" yaml:"ehlo_domain"`
	StartTLS           bool       `json:"starttls" yaml:"starttls"`
	InsecureSkipVerify bool       `json:"insecure_skip_verify" yaml:"insecure_skip_verify"`
	Auth               *AuthCreds `json:"auth,omitempty" yaml:"auth,omitempty"`
	BannerContains     string     `json:"banner_contains" yaml:"banner_contains"`
}

SMTPConfig defines SMTP check settings

type ServerConfig

type ServerConfig struct {
	Host string          `json:"host" yaml:"host"`
	Port int             `json:"port" yaml:"port"`
	TLS  TLSServerConfig `json:"tls" yaml:"tls"`
}

ServerConfig defines server settings

type Severity

type Severity string

Severity represents alert severity levels

const (
	SeverityCritical Severity = "critical"
	SeverityWarning  Severity = "warning"
	SeverityInfo     Severity = "info"
)

type SlackConfig

type SlackConfig struct {
	WebhookURL        string   `json:"webhook_url" yaml:"webhook_url"`
	Channel           string   `json:"channel" yaml:"channel"`
	Username          string   `json:"username" yaml:"username"`
	IconEmoji         string   `json:"icon_emoji" yaml:"icon_emoji"`
	MentionOnCritical []string `json:"mention_on_critical" yaml:"mention_on_critical"`
}

SlackConfig for Slack webhook notifications

type SnapshotMeta

type SnapshotMeta struct {
	ID      string `json:"id"`
	Index   uint64 `json:"index"`
	Term    uint64 `json:"term"`
	Size    int64  `json:"size"`
	Version uint64 `json:"version"`
}

SnapshotMeta holds metadata about a snapshot

type Soul

type Soul struct {
	ID          string           `json:"id" yaml:"id"`
	WorkspaceID string           `json:"workspace_id" yaml:"-"`
	Name        string           `json:"name" yaml:"name"`
	Type        CheckType        `json:"type" yaml:"type"`
	Target      string           `json:"target" yaml:"target"`
	Weight      Duration         `json:"weight" yaml:"weight"` // check interval
	Timeout     Duration         `json:"timeout" yaml:"timeout"`
	Enabled     bool             `json:"enabled" yaml:"enabled"`
	Tags        []string         `json:"tags" yaml:"tags"`
	Regions     []string         `json:"regions" yaml:"regions"` // restrict to specific regions
	Region      string           `json:"region" yaml:"region"`   // assigned region
	HTTP        *HTTPConfig      `json:"http,omitempty" yaml:"http,omitempty"`
	TCP         *TCPConfig       `json:"tcp,omitempty" yaml:"tcp,omitempty"`
	UDP         *UDPConfig       `json:"udp,omitempty" yaml:"udp,omitempty"`
	DNS         *DNSConfig       `json:"dns,omitempty" yaml:"dns,omitempty"`
	SMTP        *SMTPConfig      `json:"smtp,omitempty" yaml:"smtp,omitempty"`
	IMAP        *IMAPConfig      `json:"imap,omitempty" yaml:"imap,omitempty"`
	ICMP        *ICMPConfig      `json:"icmp,omitempty" yaml:"icmp,omitempty"`
	GRPC        *GRPCConfig      `json:"grpc,omitempty" yaml:"grpc,omitempty"`
	WebSocket   *WebSocketConfig `json:"websocket,omitempty" yaml:"websocket,omitempty"`
	TLS         *TLSConfig       `json:"tls,omitempty" yaml:"tls,omitempty"`
	CreatedAt   time.Time        `json:"created_at" yaml:"-"`
	UpdatedAt   time.Time        `json:"updated_at" yaml:"-"`
}

Soul represents a monitored target — the entity whose heart is weighed.

type SoulAssignment

type SoulAssignment struct {
	SoulID   string `json:"soul_id"`
	NodeID   string `json:"node_id"`
	Region   string `json:"region"`
	Priority int    `json:"priority"`
	IsBackup bool   `json:"is_backup"`
}

SoulAssignment represents a soul-to-node assignment

type SoulStatus

type SoulStatus string

SoulStatus represents the weighed verdict of a soul

const (
	SoulAlive    SoulStatus = "alive"    // Passed to Aaru (paradise)
	SoulDead     SoulStatus = "dead"     // Devoured by Ammit
	SoulDegraded SoulStatus = "degraded" // Heart is heavy
	SoulUnknown  SoulStatus = "unknown"  // Not yet judged
	SoulEmbalmed SoulStatus = "embalmed" // Maintenance window
)

type SoulStatusInfo

type SoulStatusInfo struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	Status        string    `json:"status"`
	UptimePercent float64   `json:"uptime_percent"`
	LastCheckedAt time.Time `json:"last_checked_at"`
	ResponseTime  float64   `json:"response_time_ms"`
}

SoulStatusInfo is soul info for status page

type Stats

type Stats struct {
	TotalSouls      int          `json:"total_souls"`
	AliveSouls      int          `json:"alive_souls"`
	DeadSouls       int          `json:"dead_souls"`
	DegradedSouls   int          `json:"degraded_souls"`
	TotalJudgments  int64        `json:"total_judgments"`
	AvgResponseTime Duration     `json:"avg_response_time"`
	UptimePercent   float64      `json:"uptime_percent"`
	ProbeStatus     *ProbeStatus `json:"probe_status"`
}

Stats represents system statistics

type StatsRequest

type StatsRequest struct{}

StatsRequest requests Raft statistics

type StatsResponse

type StatsResponse struct {
	State                    string       `json:"state"`
	Term                     uint64       `json:"term"`
	LastLogIndex             uint64       `json:"last_log_index"`
	LastLogTerm              uint64       `json:"last_log_term"`
	CommitIndex              uint64       `json:"commit_index"`
	AppliedIndex             uint64       `json:"applied_index"`
	FSMIndex                 uint64       `json:"fsm_index"`
	LastSnapshotIndex        uint64       `json:"last_snapshot_index"`
	LastSnapshotTerm         uint64       `json:"last_snapshot_term"`
	LatestConfigurationIndex uint64       `json:"latest_configuration_index"`
	LatestConfiguration      []RaftServer `json:"latest_configuration"`
	LastContact              int64        `json:"last_contact"` // milliseconds
	NumPeers                 int          `json:"num_peers"`
	LastAppliedTime          int64        `json:"last_applied_time"` // milliseconds
	Stats                    ClusterStats `json:"stats"`
}

StatsResponse returns Raft statistics

type StatusGroup

type StatusGroup struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	SoulIDs     []string `json:"soul_ids"`
	Order       int      `json:"order"`
}

StatusGroup groups souls by category

type StatusIncident

type StatusIncident struct {
	ID            string           `json:"id"`
	Title         string           `json:"title"`
	Description   string           `json:"description"`
	Status        IncidentStatus   `json:"status"`
	Severity      Severity         `json:"severity"`
	AffectedSouls []string         `json:"affected_souls"`
	StartedAt     time.Time        `json:"started_at"`
	ResolvedAt    *time.Time       `json:"resolved_at,omitempty"`
	Updates       []IncidentUpdate `json:"updates"`
}

StatusIncident is an incident displayed on the status page

type StatusPage

type StatusPage struct {
	ID           string           `json:"id" yaml:"id"`
	WorkspaceID  string           `json:"workspace_id" yaml:"workspace_id"`
	Name         string           `json:"name" yaml:"name"`
	Slug         string           `json:"slug" yaml:"slug"`
	Description  string           `json:"description" yaml:"description"`
	LogoURL      string           `json:"logo_url" yaml:"logo_url"`
	FaviconURL   string           `json:"favicon_url" yaml:"favicon_url"`
	CustomDomain string           `json:"custom_domain" yaml:"custom_domain"`
	Theme        StatusPageTheme  `json:"theme" yaml:"theme"`
	Visibility   PageVisibility   `json:"visibility" yaml:"visibility"`
	Enabled      bool             `json:"enabled" yaml:"enabled"`
	Souls        []string         `json:"souls" yaml:"souls"` // Soul IDs to display
	Groups       []StatusGroup    `json:"groups" yaml:"groups"`
	Incidents    []StatusIncident `json:"incidents" yaml:"incidents"`
	UptimeDays   int              `json:"uptime_days" yaml:"uptime_days"` // Days to show
	CreatedAt    time.Time        `json:"created_at" yaml:"-"`
	UpdatedAt    time.Time        `json:"updated_at" yaml:"-"`
}

StatusPage represents a public status page The public temple where citizens view the health of services

type StatusPageData

type StatusPageData struct {
	Page      StatusPageInfo    `json:"page"`
	Status    OverallStatus     `json:"status"`
	Souls     []SoulStatusInfo  `json:"souls"`
	Groups    []GroupStatusInfo `json:"groups"`
	Incidents []StatusIncident  `json:"incidents"`
	Uptime    UptimeData        `json:"uptime"`
}

StatusPageData is the data exposed via status page API

type StatusPageInfo

type StatusPageInfo struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Description  string `json:"description"`
	LogoURL      string `json:"logo_url"`
	CustomDomain string `json:"custom_domain,omitempty"`
}

StatusPageInfo basic page info

type StatusPageSubscription

type StatusPageSubscription struct {
	ID           string    `json:"id"`
	PageID       string    `json:"page_id"`
	Email        string    `json:"email"`
	WebhookURL   string    `json:"webhook_url"`
	Type         string    `json:"type"` // email, webhook, rss
	Confirmed    bool      `json:"confirmed"`
	SubscribedAt time.Time `json:"subscribed_at"`
}

StatusPageSubscription represents a subscription to updates

type StatusPageTheme

type StatusPageTheme struct {
	PrimaryColor    string `json:"primary_color" yaml:"primary_color"`
	BackgroundColor string `json:"background_color" yaml:"background_color"`
	TextColor       string `json:"text_color" yaml:"text_color"`
	AccentColor     string `json:"accent_color" yaml:"accent_color"`
	FontFamily      string `json:"font_family" yaml:"font_family"`
	CustomCSS       string `json:"custom_css" yaml:"custom_css"`
}

StatusPageTheme contains theme configuration

func GetDefaultTheme

func GetDefaultTheme() StatusPageTheme

GetDefaultTheme returns the default Egyptian theme

type StorageConfig

type StorageConfig struct {
	Path       string           `json:"path" yaml:"path"`
	Encryption EncryptionConfig `json:"encryption" yaml:"encryption"`
	TimeSeries TimeSeriesConfig `json:"timeseries" yaml:"timeseries"`
	BTreeOrder int              `json:"btree_order" yaml:"btree_order"` // B+Tree order (default: 32)
}

StorageConfig defines CobaltDB settings

type TCPConfig

type TCPConfig struct {
	BannerMatch string `json:"banner_match" yaml:"banner_match"`
	Send        string `json:"send" yaml:"send"`
	ExpectRegex string `json:"expect_regex" yaml:"expect_regex"`
}

TCPConfig defines TCP check settings

type TLSConfig

type TLSConfig struct {
	ExpiryWarnDays     int      `json:"expiry_warn_days" yaml:"expiry_warn_days"`
	ExpiryCriticalDays int      `json:"expiry_critical_days" yaml:"expiry_critical_days"`
	MinProtocol        string   `json:"min_protocol" yaml:"min_protocol"`
	ForbiddenCiphers   []string `json:"forbidden_ciphers" yaml:"forbidden_ciphers"`
	ExpectedIssuer     string   `json:"expected_issuer" yaml:"expected_issuer"`
	ExpectedSAN        []string `json:"expected_san" yaml:"expected_san"`
	CheckOCSP          bool     `json:"check_ocsp" yaml:"check_ocsp"`
	MinKeyBits         int      `json:"min_key_bits" yaml:"min_key_bits"`
}

TLSConfig defines TLS certificate check settings

type TLSInfo

type TLSInfo struct {
	Protocol        string    `json:"protocol"` // TLS 1.2, TLS 1.3
	CipherSuite     string    `json:"cipher_suite"`
	Issuer          string    `json:"issuer"`
	Subject         string    `json:"subject"`
	SANs            []string  `json:"sans"`
	NotBefore       time.Time `json:"not_before"`
	NotAfter        time.Time `json:"not_after"`
	DaysUntilExpiry int       `json:"days_until_expiry"`
	KeyType         string    `json:"key_type"` // RSA, ECDSA
	KeyBits         int       `json:"key_bits"`
	OCSPStapled     bool      `json:"ocsp_stapled"`
	ChainValid      bool      `json:"chain_valid"`
	ChainLength     int       `json:"chain_length"`
}

TLSInfo holds TLS/certificate details

type TLSPeerConfig

type TLSPeerConfig struct {
	CertFile          string `json:"cert_file" yaml:"cert_file"`
	KeyFile           string `json:"key_file" yaml:"key_file"`
	CAFile            string `json:"ca_file" yaml:"ca_file"`
	VerifyPeers       bool   `json:"verify_peers" yaml:"verify_peers"`
	RequireClientCert bool   `json:"require_client_cert" yaml:"require_client_cert"`
}

TLSPeerConfig holds TLS configuration for peer-to-peer communication

type TLSServerConfig

type TLSServerConfig struct {
	Enabled     bool     `json:"enabled" yaml:"enabled"`
	Cert        string   `json:"cert" yaml:"cert"`
	Key         string   `json:"key" yaml:"key"`
	AutoCert    bool     `json:"auto_cert" yaml:"auto_cert"`
	ACMEEmail   string   `json:"acme_email" yaml:"acme_email"`
	ACMEDomains []string `json:"acme_domains" yaml:"acme_domains"`
}

TLSServerConfig defines TLS settings

type TelegramConfig

type TelegramConfig struct {
	BotToken            string `json:"bot_token" yaml:"bot_token"`
	ChatID              string `json:"chat_id" yaml:"chat_id"`
	ParseMode           string `json:"parse_mode" yaml:"parse_mode"`
	DisableNotification bool   `json:"disable_notification" yaml:"disable_notification"`
}

TelegramConfig for Telegram bot notifications

type TenantsConfig

type TenantsConfig struct {
	Enabled       bool        `json:"enabled" yaml:"enabled"`
	Isolation     string      `json:"isolation" yaml:"isolation"` // strict, shared
	DefaultQuotas QuotaConfig `json:"default_quotas" yaml:"default_quotas"`
}

TenantsConfig defines multi-tenancy settings

type TimeSeriesConfig

type TimeSeriesConfig struct {
	Compaction CompactionConfig `json:"compaction" yaml:"compaction"`
	Retention  RetentionConfig  `json:"retention" yaml:"retention"`
}

TimeSeriesConfig defines time-series storage settings

type TimeoutNowRequest

type TimeoutNowRequest struct {
	Term     uint64 `json:"term"`
	LeaderID string `json:"leader_id"`
}

TimeoutNowRequest is used to force a node to start an election immediately Used during leadership transfers

type TimeoutNowResponse

type TimeoutNowResponse struct {
	Term    uint64 `json:"term"`
	Started bool   `json:"started"`
}

TimeoutNowResponse is the response to a TimeoutNow RPC

type UDPConfig

type UDPConfig struct {
	SendHex        string `json:"send_hex" yaml:"send_hex"`
	ExpectContains string `json:"expect_contains" yaml:"expect_contains"`
}

UDPConfig defines UDP check settings

type ULID

type ULID [16]byte

ULID is a 16-byte Universally Unique Lexicographically Sortable Identifier. Format: 48-bit timestamp (milliseconds) + 80-bit randomness Encoded as 26 characters using Crockford's Base32.

var ZeroULID ULID

ZeroULID is the zero ULID value.

func GenerateULID

func GenerateULID() (ULID, error)

GenerateULID creates a new ULID with the current timestamp.

func GenerateULIDAt

func GenerateULIDAt(t time.Time) (ULID, error)

GenerateULIDAt creates a new ULID with the specified timestamp.

func MustGenerateULID

func MustGenerateULID() ULID

MustGenerateULID generates a ULID, panicking on error.

func ParseULID

func ParseULID(s string) (ULID, error)

ParseULID parses a ULID string.

func (ULID) Compare

func (u ULID) Compare(other ULID) int

Compare returns an integer comparing two ULIDs lexicographically.

func (ULID) MarshalJSON

func (u ULID) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (ULID) MarshalText

func (u ULID) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (ULID) String

func (u ULID) String() string

String returns the ULID as a 26-character string.

func (ULID) Time

func (u ULID) Time() time.Time

Time returns the timestamp component as time.Time.

func (*ULID) UnmarshalJSON

func (u *ULID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*ULID) UnmarshalText

func (u *ULID) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type UnauthorizedError

type UnauthorizedError struct {
	Message string
}

UnauthorizedError represents authentication failure

func (*UnauthorizedError) Code

func (e *UnauthorizedError) Code() int

func (*UnauthorizedError) Error

func (e *UnauthorizedError) Error() string

func (*UnauthorizedError) Slug

func (e *UnauthorizedError) Slug() string

type UptimeData

type UptimeData struct {
	Days    []UptimeDay `json:"days"`
	Overall float64     `json:"overall_percent"`
}

UptimeData contains historical uptime

type UptimeDay

type UptimeDay struct {
	Date   string  `json:"date"` // YYYY-MM-DD
	Status string  `json:"status"`
	Uptime float64 `json:"uptime_percent"`
}

UptimeDay is a single day's uptime

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents an input validation error

func (*ValidationError) Code

func (e *ValidationError) Code() int

func (*ValidationError) Error

func (e *ValidationError) Error() string

func (*ValidationError) Slug

func (e *ValidationError) Slug() string

type Verdict

type Verdict struct {
	ID             string        `json:"id"`
	WorkspaceID    string        `json:"workspace_id"`
	SoulID         string        `json:"soul_id"`
	RuleID         string        `json:"rule_id"`
	Severity       Severity      `json:"severity"`
	Status         VerdictStatus `json:"status"`
	Message        string        `json:"message"`
	FiredAt        time.Time     `json:"fired_at"`
	AcknowledgedAt *time.Time    `json:"acknowledged_at,omitempty"`
	AcknowledgedBy string        `json:"acknowledged_by,omitempty"`
	ResolvedAt     *time.Time    `json:"resolved_at,omitempty"`
	Judgments      []string      `json:"judgments"` // judgment IDs that caused this
}

Verdict is the alert decision — the judgment pronounced upon a soul.

type VerdictStatus

type VerdictStatus string

VerdictStatus represents the current state of a verdict

const (
	VerdictActive       VerdictStatus = "active"
	VerdictAcknowledged VerdictStatus = "acknowledged"
	VerdictResolved     VerdictStatus = "resolved"
)

type VerdictsConfig

type VerdictsConfig struct {
	Rules      []AlertRule        `json:"rules" yaml:"rules"`
	Escalation []EscalationPolicy `json:"escalation,omitempty" yaml:"escalation,omitempty"`
}

VerdictsConfig holds alert rules configuration

type VerifyLeaderRequest

type VerifyLeaderRequest struct{}

VerifyLeaderRequest verifies if the current node is still the leader

type VerifyLeaderResponse

type VerifyLeaderResponse struct {
	IsLeader bool   `json:"is_leader"`
	LeaderID string `json:"leader_id,omitempty"`
	Term     uint64 `json:"term"`
}

VerifyLeaderResponse is the response to a VerifyLeaderRequest

type WebSocketConfig

type WebSocketConfig struct {
	Headers            map[string]string `json:"headers" yaml:"headers"`
	Subprotocols       []string          `json:"subprotocols" yaml:"subprotocols"`
	Send               string            `json:"send" yaml:"send"`
	ExpectContains     string            `json:"expect_contains" yaml:"expect_contains"`
	PingCheck          bool              `json:"ping_check" yaml:"ping_check"`
	Feather            Duration          `json:"feather" yaml:"feather"`
	InsecureSkipVerify bool              `json:"insecure_skip_verify" yaml:"insecure_skip_verify"`
}

WebSocketConfig defines WebSocket check settings

type WebhookConfig

type WebhookConfig struct {
	URL      string            `json:"url" yaml:"url"`
	Method   string            `json:"method" yaml:"method"`
	Headers  map[string]string `json:"headers" yaml:"headers"`
	Template string            `json:"template" yaml:"template"`
}

WebhookConfig for generic webhook notifications

type Workspace

type Workspace struct {
	ID          string            `json:"id" yaml:"id"`
	Name        string            `json:"name" yaml:"name"`
	Slug        string            `json:"slug" yaml:"slug"` // URL-friendly identifier
	Description string            `json:"description" yaml:"description"`
	OwnerID     string            `json:"owner_id" yaml:"owner_id"`
	Settings    WorkspaceSettings `json:"settings" yaml:"settings"`
	Quotas      QuotaConfig       `json:"quotas" yaml:"quotas"`
	Features    FeatureFlags      `json:"features" yaml:"features"`
	Status      WorkspaceStatus   `json:"status" yaml:"status"`
	CreatedAt   time.Time         `json:"created_at" yaml:"-"`
	UpdatedAt   time.Time         `json:"updated_at" yaml:"-"`
	DeletedAt   *time.Time        `json:"deleted_at,omitempty" yaml:"-"`
}

Workspace represents a multi-tenant workspace Each workspace is like a separate necropolis

func (*Workspace) NamespaceKey

func (w *Workspace) NamespaceKey(key string) string

NamespaceKey returns the storage key prefix for a workspace

type WorkspaceBranding

type WorkspaceBranding struct {
	LogoURL       string `json:"logo_url" yaml:"logo_url"`
	FaviconURL    string `json:"favicon_url" yaml:"favicon_url"`
	PrimaryColor  string `json:"primary_color" yaml:"primary_color"`
	AccentColor   string `json:"accent_color" yaml:"accent_color"`
	CustomCSS     string `json:"custom_css" yaml:"custom_css"`
	HidePoweredBy bool   `json:"hide_powered_by" yaml:"hide_powered_by"`
}

WorkspaceBranding contains custom branding settings

type WorkspaceSettings

type WorkspaceSettings struct {
	Timezone        string            `json:"timezone" yaml:"timezone"`
	DateFormat      string            `json:"date_format" yaml:"date_format"`
	StatusPageTheme string            `json:"status_page_theme" yaml:"status_page_theme"`
	Branding        WorkspaceBranding `json:"branding" yaml:"branding"`
	Notifications   NotificationPrefs `json:"notifications" yaml:"notifications"`
}

WorkspaceSettings contains workspace-specific settings

type WorkspaceStats

type WorkspaceStats struct {
	WorkspaceID      string    `json:"workspace_id"`
	TotalSouls       int       `json:"total_souls"`
	HealthySouls     int       `json:"healthy_souls"`
	DegradedSouls    int       `json:"degraded_souls"`
	DeadSouls        int       `json:"dead_souls"`
	TotalJudgments   int64     `json:"total_judgments"`
	FailedJudgments  int64     `json:"failed_judgments"`
	TotalIncidents   int       `json:"total_incidents"`
	ActiveIncidents  int       `json:"active_incidents"`
	AvgUptimePercent float64   `json:"avg_uptime_percent"`
	AvgLatency       float64   `json:"avg_latency_ms"`
	PeriodStart      time.Time `json:"period_start"`
	PeriodEnd        time.Time `json:"period_end"`
}

WorkspaceStats contains workspace statistics

type WorkspaceStatus

type WorkspaceStatus string

WorkspaceStatus represents workspace lifecycle state

const (
	WorkspaceActive    WorkspaceStatus = "active"
	WorkspaceSuspended WorkspaceStatus = "suspended"
	WorkspaceTrial     WorkspaceStatus = "trial"
	WorkspaceDeleted   WorkspaceStatus = "deleted"
)

Jump to

Keyboard shortcuts

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