Documentation
¶
Index ¶
- type CobaltDB
- func (db *CobaltDB) AcknowledgeVerdict(ctx context.Context, workspaceID, verdictID, user string) error
- func (db *CobaltDB) Close() error
- func (db *CobaltDB) Delete(key string) error
- func (db *CobaltDB) DeleteAlertChannel(id string) error
- func (db *CobaltDB) DeleteAlertRule(id string) error
- func (db *CobaltDB) DeleteChannel(ctx context.Context, id string) error
- func (db *CobaltDB) DeleteChannelNoCtx(id string) error
- func (db *CobaltDB) DeleteJourney(ctx context.Context, workspaceID, journeyID string) error
- func (db *CobaltDB) DeleteJourneyNoCtx(id string) error
- func (db *CobaltDB) DeletePrefix(prefix string) error
- func (db *CobaltDB) DeleteRule(ctx context.Context, id string) error
- func (db *CobaltDB) DeleteRuleNoCtx(id string) error
- func (db *CobaltDB) DeleteSoul(ctx context.Context, workspaceID, soulID string) error
- func (db *CobaltDB) DeleteStatusPage(id string) error
- func (db *CobaltDB) DeleteStatusPageNoCtx(id string) error
- func (db *CobaltDB) DeleteStatusPageSubscription(subscriptionID string) error
- func (db *CobaltDB) DeleteWorkspace(ctx context.Context, id string) error
- func (db *CobaltDB) DeleteWorkspaceNoCtx(id string) error
- func (db *CobaltDB) Get(key string) ([]byte, error)
- func (db *CobaltDB) GetActiveVerdicts(ctx context.Context, workspaceID, soulID string) ([]*core.Verdict, error)
- func (db *CobaltDB) GetAlertChannel(id string) (*core.AlertChannel, error)
- func (db *CobaltDB) GetAlertRule(id string) (*core.AlertRule, error)
- func (db *CobaltDB) GetChannel(ctx context.Context, id string) (*core.ChannelConfig, error)
- func (db *CobaltDB) GetChannelNoCtx(id string) (*core.AlertChannel, error)
- func (db *CobaltDB) GetIncident(id string) (*core.Incident, error)
- func (db *CobaltDB) GetJourney(ctx context.Context, workspaceID, journeyID string) (*core.JourneyConfig, error)
- func (db *CobaltDB) GetJourneyNoCtx(id string) (*core.JourneyConfig, error)
- func (db *CobaltDB) GetJudgment(ctx context.Context, workspaceID, soulID string, timestamp time.Time) (*core.Judgment, error)
- func (db *CobaltDB) GetJudgmentNoCtx(id string) (*core.Judgment, error)
- func (db *CobaltDB) GetLatestJudgment(ctx context.Context, workspaceID, soulID string) (*core.Judgment, error)
- func (db *CobaltDB) GetRaftLogEntry(ctx context.Context, index uint64) (term uint64, data []byte, err error)
- func (db *CobaltDB) GetRaftState(ctx context.Context) (currentTerm uint64, votedFor string, err error)
- func (db *CobaltDB) GetRule(ctx context.Context, id string) (*core.AlertRule, error)
- func (db *CobaltDB) GetRuleNoCtx(id string) (*core.AlertRule, error)
- func (db *CobaltDB) GetSoul(ctx context.Context, workspaceID, soulID string) (*core.Soul, error)
- func (db *CobaltDB) GetSoulJudgments(soulID string, limit int) ([]core.Judgment, error)
- func (db *CobaltDB) GetSoulNoCtx(id string) (*core.Soul, error)
- func (db *CobaltDB) GetSoulPurity(ctx context.Context, workspaceID, soulID string, window time.Duration) (float64, error)
- func (db *CobaltDB) GetStats(ctx context.Context, workspaceID string, start, end time.Time) (*core.Stats, error)
- func (db *CobaltDB) GetStatsNoCtx(workspace string, start, end time.Time) (*core.Stats, error)
- func (db *CobaltDB) GetStatusPage(id string) (*core.StatusPage, error)
- func (db *CobaltDB) GetStatusPageByDomain(domain string) (*core.StatusPage, error)
- func (db *CobaltDB) GetStatusPageBySlug(slug string) (*core.StatusPage, error)
- func (db *CobaltDB) GetStatusPageNoCtx(id string) (*core.StatusPage, error)
- func (db *CobaltDB) GetSubscriptionsByPage(pageID string) ([]*core.StatusPageSubscription, error)
- func (db *CobaltDB) GetSystemConfig(ctx context.Context, key string) ([]byte, error)
- func (db *CobaltDB) GetUptimeHistory(soulID string, days int) ([]core.UptimeDay, error)
- func (db *CobaltDB) GetVerdict(ctx context.Context, workspaceID, verdictID string) (*core.Verdict, error)
- func (db *CobaltDB) GetWorkspace(ctx context.Context, id string) (*core.Workspace, error)
- func (db *CobaltDB) GetWorkspaceNoCtx(id string) (*core.Workspace, error)
- func (db *CobaltDB) List(prefix string) ([]string, error)
- func (db *CobaltDB) ListActiveIncidents() ([]*core.Incident, error)
- func (db *CobaltDB) ListAlertChannels() ([]*core.AlertChannel, error)
- func (db *CobaltDB) ListAlertEvents(soulID string, limit int) ([]*core.AlertEvent, error)
- func (db *CobaltDB) ListAlertRules() ([]*core.AlertRule, error)
- func (db *CobaltDB) ListChannels(ctx context.Context, workspaceID string) ([]*core.ChannelConfig, error)
- func (db *CobaltDB) ListChannelsNoCtx(workspace string) ([]*core.AlertChannel, error)
- func (db *CobaltDB) ListJackals(ctx context.Context) (map[string]map[string]string, error)
- func (db *CobaltDB) ListJourneys(ctx context.Context, workspaceID string) ([]*core.JourneyConfig, error)
- func (db *CobaltDB) ListJourneysNoCtx(workspace string, offset, limit int) ([]*core.JourneyConfig, error)
- func (db *CobaltDB) ListJudgments(ctx context.Context, soulID string, start, end time.Time, limit int) ([]*core.Judgment, error)
- func (db *CobaltDB) ListJudgmentsNoCtx(soulID string, start, end time.Time, limit int) ([]*core.Judgment, error)
- func (db *CobaltDB) ListRules(ctx context.Context, workspaceID string) ([]*core.AlertRule, error)
- func (db *CobaltDB) ListRulesNoCtx(workspace string) ([]*core.AlertRule, error)
- func (db *CobaltDB) ListSouls(ctx context.Context, workspaceID string, offset, limit int) ([]*core.Soul, error)
- func (db *CobaltDB) ListSoulsNoCtx(workspace string, offset, limit int) ([]*core.Soul, error)
- func (db *CobaltDB) ListStatusPages() ([]*core.StatusPage, error)
- func (db *CobaltDB) ListStatusPagesNoCtx() ([]*core.StatusPage, error)
- func (db *CobaltDB) ListVerdicts(ctx context.Context, workspaceID string, status core.VerdictStatus, limit int) ([]*core.Verdict, error)
- func (db *CobaltDB) ListWorkspaces(ctx context.Context) ([]*core.Workspace, error)
- func (db *CobaltDB) ListWorkspacesNoCtx() ([]*core.Workspace, error)
- func (db *CobaltDB) PrefixScan(prefix string) (map[string][]byte, error)
- func (db *CobaltDB) Put(key string, value []byte) error
- func (db *CobaltDB) QueryJourneyRuns(ctx context.Context, workspaceID, journeyID string, limit int) ([]*core.JourneyRun, error)
- func (db *CobaltDB) QueryJudgments(ctx context.Context, workspaceID, soulID string, start, end time.Time, ...) ([]*core.Judgment, error)
- func (db *CobaltDB) RangeScan(start, end string) (map[string][]byte, error)
- func (db *CobaltDB) SaveAlertChannel(ch *core.AlertChannel) error
- func (db *CobaltDB) SaveAlertEvent(event *core.AlertEvent) error
- func (db *CobaltDB) SaveAlertRule(rule *core.AlertRule) error
- func (db *CobaltDB) SaveChannel(ctx context.Context, ch *core.ChannelConfig) error
- func (db *CobaltDB) SaveChannelNoCtx(ch *core.AlertChannel) error
- func (db *CobaltDB) SaveIncident(incident *core.Incident) error
- func (db *CobaltDB) SaveJackal(ctx context.Context, nodeID, address, region string) error
- func (db *CobaltDB) SaveJourney(ctx context.Context, j *core.JourneyConfig) error
- func (db *CobaltDB) SaveJourneyNoCtx(journey *core.JourneyConfig) error
- func (db *CobaltDB) SaveJourneyRun(ctx context.Context, run *core.JourneyRun) error
- func (db *CobaltDB) SaveJudgment(ctx context.Context, j *core.Judgment) error
- func (db *CobaltDB) SaveRaftLogEntry(ctx context.Context, index uint64, term uint64, data []byte) error
- func (db *CobaltDB) SaveRaftState(ctx context.Context, currentTerm uint64, votedFor string) error
- func (db *CobaltDB) SaveRule(ctx context.Context, rule *core.AlertRule) error
- func (db *CobaltDB) SaveRuleNoCtx(rule *core.AlertRule) error
- func (db *CobaltDB) SaveSoul(ctx context.Context, soul *core.Soul) error
- func (db *CobaltDB) SaveStatusPage(page *core.StatusPage) error
- func (db *CobaltDB) SaveStatusPageNoCtx(page *core.StatusPage) error
- func (db *CobaltDB) SaveStatusPageSubscription(sub *core.StatusPageSubscription) error
- func (db *CobaltDB) SaveSystemConfig(ctx context.Context, key string, value []byte) error
- func (db *CobaltDB) SaveVerdict(ctx context.Context, v *core.Verdict) error
- func (db *CobaltDB) SaveWorkspace(ctx context.Context, ws *core.Workspace) error
- func (db *CobaltDB) SaveWorkspaceNoCtx(ws *core.Workspace) error
- func (db *CobaltDB) Set(key string, value []byte) error
- func (db *CobaltDB) UpdateVerdictStatus(ctx context.Context, workspaceID, verdictID string, status core.VerdictStatus) error
- type CobaltDBLogStore
- func (s *CobaltDBLogStore) DeleteRange(min, max uint64) error
- func (s *CobaltDBLogStore) FirstIndex() (uint64, error)
- func (s *CobaltDBLogStore) GetLog(index uint64, log *core.RaftLogEntry) error
- func (s *CobaltDBLogStore) LastIndex() (uint64, error)
- func (s *CobaltDBLogStore) StoreLog(log *core.RaftLogEntry) error
- func (s *CobaltDBLogStore) StoreLogs(logs []core.RaftLogEntry) error
- type CobaltDBSnapshotStore
- type CobaltDBStableStore
- type JudgmentSummary
- type RetentionManager
- type StatusPageRepository
- func (r *StatusPageRepository) AddIncident(pageID string, incident core.StatusIncident) error
- func (r *StatusPageRepository) DeleteStatusPage(id string) error
- func (r *StatusPageRepository) DeleteSubscription(subscriptionID string) error
- func (r *StatusPageRepository) GetIncidentsByPage(pageID string) ([]core.StatusIncident, error)
- func (r *StatusPageRepository) GetSoul(id string) (*core.Soul, error)
- func (r *StatusPageRepository) GetSoulJudgments(soulID string, limit int) ([]core.Judgment, error)
- func (r *StatusPageRepository) GetStatusPage(id string) (*core.StatusPage, error)
- func (r *StatusPageRepository) GetStatusPageByDomain(domain string) (*core.StatusPage, error)
- func (r *StatusPageRepository) GetStatusPageBySlug(slug string) (*core.StatusPage, error)
- func (r *StatusPageRepository) GetSubscriptionsByPage(pageID string) ([]*core.StatusPageSubscription, error)
- func (r *StatusPageRepository) GetUptimeHistory(soulID string, days int) ([]core.UptimeDay, error)
- func (r *StatusPageRepository) GetWorkspace(id string) (*core.Workspace, error)
- func (r *StatusPageRepository) ListStatusPages(workspaceID string) ([]*core.StatusPage, error)
- func (r *StatusPageRepository) SaveStatusPage(page *core.StatusPage) error
- func (r *StatusPageRepository) SaveSubscription(sub *core.StatusPageSubscription) error
- func (r *StatusPageRepository) SaveUptimeDay(soulID string, day core.UptimeDay) error
- func (r *StatusPageRepository) UpdateIncident(pageID string, incidentID string, updates core.StatusIncident) error
- type StorageStats
- type TimeResolution
- type TimeSeriesStore
- func (ts *TimeSeriesStore) GetPurityFromSummaries(ctx context.Context, workspaceID, soulID string, window time.Duration) (float64, error)
- func (ts *TimeSeriesStore) QuerySummaries(ctx context.Context, workspaceID, soulID string, resolution TimeResolution, ...) ([]*JudgmentSummary, error)
- func (ts *TimeSeriesStore) SaveJudgment(ctx context.Context, j *core.Judgment) error
- func (ts *TimeSeriesStore) StartCompaction()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CobaltDB ¶
type CobaltDB struct {
// contains filtered or unexported fields
}
CobaltDB implements a B+Tree-based embedded storage engine optimized for time-series monitoring data with MVCC support.
func (*CobaltDB) AcknowledgeVerdict ¶
func (db *CobaltDB) AcknowledgeVerdict(ctx context.Context, workspaceID, verdictID, user string) error
AcknowledgeVerdict marks a verdict as acknowledged
func (*CobaltDB) DeleteAlertChannel ¶
DeleteAlertChannel removes an alert channel
func (*CobaltDB) DeleteAlertRule ¶
DeleteAlertRule removes an alert rule
func (*CobaltDB) DeleteChannel ¶
DeleteChannel removes a channel
func (*CobaltDB) DeleteChannelNoCtx ¶
DeleteChannelNoCtx deletes a channel
func (*CobaltDB) DeleteJourney ¶
DeleteJourney removes a journey
func (*CobaltDB) DeleteJourneyNoCtx ¶ added in v0.1.0
func (*CobaltDB) DeletePrefix ¶
DeletePrefix removes all key-value pairs with the given prefix
func (*CobaltDB) DeleteRule ¶
DeleteRule removes an alert rule
func (*CobaltDB) DeleteRuleNoCtx ¶
DeleteRuleNoCtx deletes a rule
func (*CobaltDB) DeleteSoul ¶
DeleteSoul removes a soul
func (*CobaltDB) DeleteStatusPage ¶
func (*CobaltDB) DeleteStatusPageNoCtx ¶
func (*CobaltDB) DeleteStatusPageSubscription ¶
func (*CobaltDB) DeleteWorkspace ¶
DeleteWorkspace removes a workspace
func (*CobaltDB) DeleteWorkspaceNoCtx ¶
DeleteWorkspaceNoCtx deletes a workspace
func (*CobaltDB) GetActiveVerdicts ¶
func (db *CobaltDB) GetActiveVerdicts(ctx context.Context, workspaceID, soulID string) ([]*core.Verdict, error)
GetActiveVerdicts returns all active (non-resolved) verdicts for a soul
func (*CobaltDB) GetAlertChannel ¶
func (db *CobaltDB) GetAlertChannel(id string) (*core.AlertChannel, error)
GetAlertChannel retrieves an alert channel by ID
func (*CobaltDB) GetAlertRule ¶
GetAlertRule retrieves an alert rule by ID
func (*CobaltDB) GetChannel ¶
GetChannel retrieves a channel by name
func (*CobaltDB) GetChannelNoCtx ¶
func (db *CobaltDB) GetChannelNoCtx(id string) (*core.AlertChannel, error)
GetChannelNoCtx retrieves a channel by ID
func (*CobaltDB) GetIncident ¶
GetIncident retrieves an incident by ID
func (*CobaltDB) GetJourney ¶
func (db *CobaltDB) GetJourney(ctx context.Context, workspaceID, journeyID string) (*core.JourneyConfig, error)
GetJourney retrieves a journey by ID
func (*CobaltDB) GetJourneyNoCtx ¶ added in v0.1.0
func (db *CobaltDB) GetJourneyNoCtx(id string) (*core.JourneyConfig, error)
func (*CobaltDB) GetJudgment ¶
func (db *CobaltDB) GetJudgment(ctx context.Context, workspaceID, soulID string, timestamp time.Time) (*core.Judgment, error)
GetJudgment retrieves a judgment by soul ID and timestamp
func (*CobaltDB) GetJudgmentNoCtx ¶
GetJudgmentNoCtx retrieves a judgment by ID
func (*CobaltDB) GetLatestJudgment ¶
func (db *CobaltDB) GetLatestJudgment(ctx context.Context, workspaceID, soulID string) (*core.Judgment, error)
GetLatestJudgment retrieves the most recent judgment for a soul
func (*CobaltDB) GetRaftLogEntry ¶
func (db *CobaltDB) GetRaftLogEntry(ctx context.Context, index uint64) (term uint64, data []byte, err error)
GetRaftLogEntry retrieves a Raft log entry
func (*CobaltDB) GetRaftState ¶
func (db *CobaltDB) GetRaftState(ctx context.Context) (currentTerm uint64, votedFor string, err error)
GetRaftState retrieves Raft persistent state
func (*CobaltDB) GetRuleNoCtx ¶
GetRuleNoCtx retrieves a rule by ID
func (*CobaltDB) GetSoulJudgments ¶
GetSoulJudgments retrieves recent judgments for a soul (for status page)
func (*CobaltDB) GetSoulNoCtx ¶
GetSoulNoCtx retrieves a soul by ID (REST API compatible)
func (*CobaltDB) GetSoulPurity ¶
func (db *CobaltDB) GetSoulPurity(ctx context.Context, workspaceID, soulID string, window time.Duration) (float64, error)
GetSoulPurity calculates uptime percentage for a soul over a time window
func (*CobaltDB) GetStats ¶
func (db *CobaltDB) GetStats(ctx context.Context, workspaceID string, start, end time.Time) (*core.Stats, error)
GetStats returns statistics for a workspace
func (*CobaltDB) GetStatsNoCtx ¶
GetStatsNoCtx gets stats without context
func (*CobaltDB) GetStatusPage ¶
func (db *CobaltDB) GetStatusPage(id string) (*core.StatusPage, error)
func (*CobaltDB) GetStatusPageByDomain ¶
func (db *CobaltDB) GetStatusPageByDomain(domain string) (*core.StatusPage, error)
func (*CobaltDB) GetStatusPageBySlug ¶
func (db *CobaltDB) GetStatusPageBySlug(slug string) (*core.StatusPage, error)
func (*CobaltDB) GetStatusPageNoCtx ¶
func (db *CobaltDB) GetStatusPageNoCtx(id string) (*core.StatusPage, error)
func (*CobaltDB) GetSubscriptionsByPage ¶
func (db *CobaltDB) GetSubscriptionsByPage(pageID string) ([]*core.StatusPageSubscription, error)
func (*CobaltDB) GetSystemConfig ¶
GetSystemConfig retrieves system configuration
func (*CobaltDB) GetUptimeHistory ¶
func (*CobaltDB) GetVerdict ¶
func (db *CobaltDB) GetVerdict(ctx context.Context, workspaceID, verdictID string) (*core.Verdict, error)
GetVerdict retrieves a verdict by ID
func (*CobaltDB) GetWorkspace ¶
GetWorkspace retrieves a workspace by ID
func (*CobaltDB) GetWorkspaceNoCtx ¶
GetWorkspaceNoCtx retrieves a workspace
func (*CobaltDB) ListActiveIncidents ¶
ListActiveIncidents returns all non-resolved incidents
func (*CobaltDB) ListAlertChannels ¶
func (db *CobaltDB) ListAlertChannels() ([]*core.AlertChannel, error)
ListAlertChannels returns all alert channels
func (*CobaltDB) ListAlertEvents ¶
ListAlertEvents returns alert events for a soul
func (*CobaltDB) ListAlertRules ¶
ListAlertRules returns all alert rules
func (*CobaltDB) ListChannels ¶
func (db *CobaltDB) ListChannels(ctx context.Context, workspaceID string) ([]*core.ChannelConfig, error)
ListChannels returns all channels in a workspace
func (*CobaltDB) ListChannelsNoCtx ¶
func (db *CobaltDB) ListChannelsNoCtx(workspace string) ([]*core.AlertChannel, error)
ListChannelsNoCtx lists channels
func (*CobaltDB) ListJackals ¶
ListJackals returns all registered nodes
func (*CobaltDB) ListJourneys ¶
func (db *CobaltDB) ListJourneys(ctx context.Context, workspaceID string) ([]*core.JourneyConfig, error)
ListJourneys returns all journeys in a workspace
func (*CobaltDB) ListJourneysNoCtx ¶ added in v0.1.0
func (*CobaltDB) ListJudgments ¶
func (db *CobaltDB) ListJudgments(ctx context.Context, soulID string, start, end time.Time, limit int) ([]*core.Judgment, error)
ListJudgments returns judgments for a soul within a time range
func (*CobaltDB) ListJudgmentsNoCtx ¶
func (db *CobaltDB) ListJudgmentsNoCtx(soulID string, start, end time.Time, limit int) ([]*core.Judgment, error)
ListJudgmentsNoCtx lists judgments in time range
func (*CobaltDB) ListRulesNoCtx ¶
ListRulesNoCtx lists rules
func (*CobaltDB) ListSouls ¶
func (db *CobaltDB) ListSouls(ctx context.Context, workspaceID string, offset, limit int) ([]*core.Soul, error)
ListSouls returns all souls in a workspace with pagination
func (*CobaltDB) ListSoulsNoCtx ¶
ListSoulsNoCtx lists souls for REST API (no context)
func (*CobaltDB) ListStatusPages ¶
func (db *CobaltDB) ListStatusPages() ([]*core.StatusPage, error)
func (*CobaltDB) ListStatusPagesNoCtx ¶
func (db *CobaltDB) ListStatusPagesNoCtx() ([]*core.StatusPage, error)
func (*CobaltDB) ListVerdicts ¶
func (db *CobaltDB) ListVerdicts(ctx context.Context, workspaceID string, status core.VerdictStatus, limit int) ([]*core.Verdict, error)
ListVerdicts returns verdicts for a workspace with optional filters
func (*CobaltDB) ListWorkspaces ¶
ListWorkspaces returns all workspaces
func (*CobaltDB) ListWorkspacesNoCtx ¶
ListWorkspacesNoCtx lists workspaces
func (*CobaltDB) PrefixScan ¶
PrefixScan returns all key-value pairs with the given prefix
func (*CobaltDB) QueryJourneyRuns ¶
func (db *CobaltDB) QueryJourneyRuns(ctx context.Context, workspaceID, journeyID string, limit int) ([]*core.JourneyRun, error)
QueryJourneyRuns retrieves runs for a journey
func (*CobaltDB) QueryJudgments ¶
func (db *CobaltDB) QueryJudgments(ctx context.Context, workspaceID, soulID string, start, end time.Time, limit int) ([]*core.Judgment, error)
QueryJudgments retrieves judgments for a soul within a time range
func (*CobaltDB) SaveAlertChannel ¶
func (db *CobaltDB) SaveAlertChannel(ch *core.AlertChannel) error
SaveAlertChannel saves an alert channel
func (*CobaltDB) SaveAlertEvent ¶
func (db *CobaltDB) SaveAlertEvent(event *core.AlertEvent) error
SaveAlertEvent saves an alert event
func (*CobaltDB) SaveAlertRule ¶
SaveAlertRule saves an alert rule
func (*CobaltDB) SaveChannel ¶
SaveChannel saves an alert channel configuration
func (*CobaltDB) SaveChannelNoCtx ¶
func (db *CobaltDB) SaveChannelNoCtx(ch *core.AlertChannel) error
SaveChannelNoCtx saves a channel without context
func (*CobaltDB) SaveIncident ¶
SaveIncident saves an incident
func (*CobaltDB) SaveJackal ¶
SaveJackal registers a cluster node
func (*CobaltDB) SaveJourney ¶
SaveJourney saves a journey configuration
func (*CobaltDB) SaveJourneyNoCtx ¶ added in v0.1.0
func (db *CobaltDB) SaveJourneyNoCtx(journey *core.JourneyConfig) error
func (*CobaltDB) SaveJourneyRun ¶
SaveJourneyRun saves a journey execution result
func (*CobaltDB) SaveJudgment ¶
SaveJudgment saves a judgment to time-series storage
func (*CobaltDB) SaveRaftLogEntry ¶
func (db *CobaltDB) SaveRaftLogEntry(ctx context.Context, index uint64, term uint64, data []byte) error
SaveRaftLogEntry saves a Raft log entry
func (*CobaltDB) SaveRaftState ¶
SaveRaftState saves Raft persistent state
func (*CobaltDB) SaveRuleNoCtx ¶
SaveRuleNoCtx saves a rule without context
func (*CobaltDB) SaveStatusPage ¶
func (db *CobaltDB) SaveStatusPage(page *core.StatusPage) error
func (*CobaltDB) SaveStatusPageNoCtx ¶
func (db *CobaltDB) SaveStatusPageNoCtx(page *core.StatusPage) error
func (*CobaltDB) SaveStatusPageSubscription ¶
func (db *CobaltDB) SaveStatusPageSubscription(sub *core.StatusPageSubscription) error
func (*CobaltDB) SaveSystemConfig ¶
SaveSystemConfig saves global system configuration
func (*CobaltDB) SaveVerdict ¶
SaveVerdict saves a verdict to storage
func (*CobaltDB) SaveWorkspace ¶
SaveWorkspace saves a workspace
func (*CobaltDB) SaveWorkspaceNoCtx ¶
SaveWorkspaceNoCtx saves a workspace
func (*CobaltDB) Set ¶
Set stores a key-value pair (alias for Put to satisfy raft.Storage interface)
func (*CobaltDB) UpdateVerdictStatus ¶
func (db *CobaltDB) UpdateVerdictStatus(ctx context.Context, workspaceID, verdictID string, status core.VerdictStatus) error
UpdateVerdictStatus updates a verdict's status
type CobaltDBLogStore ¶
type CobaltDBLogStore struct {
// contains filtered or unexported fields
}
CobaltDBLogStore implements the raft.LogStore interface using CobaltDB
func NewCobaltDBLogStore ¶
func NewCobaltDBLogStore(db *CobaltDB) *CobaltDBLogStore
NewCobaltDBLogStore creates a new LogStore backed by CobaltDB
func (*CobaltDBLogStore) DeleteRange ¶
func (s *CobaltDBLogStore) DeleteRange(min, max uint64) error
DeleteRange deletes all log entries in the given range (inclusive)
func (*CobaltDBLogStore) FirstIndex ¶
func (s *CobaltDBLogStore) FirstIndex() (uint64, error)
FirstIndex returns the first index in the log
func (*CobaltDBLogStore) GetLog ¶
func (s *CobaltDBLogStore) GetLog(index uint64, log *core.RaftLogEntry) error
GetLog retrieves a log entry at the given index
func (*CobaltDBLogStore) LastIndex ¶
func (s *CobaltDBLogStore) LastIndex() (uint64, error)
LastIndex returns the last index in the log
func (*CobaltDBLogStore) StoreLog ¶
func (s *CobaltDBLogStore) StoreLog(log *core.RaftLogEntry) error
StoreLog stores a single log entry
func (*CobaltDBLogStore) StoreLogs ¶
func (s *CobaltDBLogStore) StoreLogs(logs []core.RaftLogEntry) error
StoreLogs stores multiple log entries in batch
type CobaltDBSnapshotStore ¶
type CobaltDBSnapshotStore struct {
// contains filtered or unexported fields
}
CobaltDBSnapshotStore implements raft.SnapshotStore
func NewCobaltDBSnapshotStore ¶
func NewCobaltDBSnapshotStore(db *CobaltDB) *CobaltDBSnapshotStore
NewCobaltDBSnapshotStore creates a new SnapshotStore backed by CobaltDB
func (*CobaltDBSnapshotStore) Create ¶
func (s *CobaltDBSnapshotStore) Create(version, index, term uint64, configuration []byte) (raft.SnapshotSink, error)
Create creates a new snapshot
func (*CobaltDBSnapshotStore) List ¶
func (s *CobaltDBSnapshotStore) List() ([]raft.SnapshotMeta, error)
List returns metadata for all snapshots
func (*CobaltDBSnapshotStore) Open ¶
func (s *CobaltDBSnapshotStore) Open(id string) (raft.SnapshotSource, error)
Open opens a snapshot for reading
type CobaltDBStableStore ¶
type CobaltDBStableStore struct {
// contains filtered or unexported fields
}
CobaltDBStableStore implements raft.StableStore for stable storage
func NewCobaltDBStableStore ¶
func NewCobaltDBStableStore(db *CobaltDB) *CobaltDBStableStore
NewCobaltDBStableStore creates a new StableStore backed by CobaltDB
func (*CobaltDBStableStore) Get ¶
func (s *CobaltDBStableStore) Get(key string) ([]byte, error)
Get retrieves a byte slice
func (*CobaltDBStableStore) GetUint64 ¶
func (s *CobaltDBStableStore) GetUint64(key string) (uint64, error)
GetUint64 retrieves a uint64 value
type JudgmentSummary ¶
type JudgmentSummary struct {
SoulID string `json:"soul_id"`
WorkspaceID string `json:"workspace_id"`
Resolution string `json:"resolution"`
BucketTime time.Time `json:"bucket_time"`
Count int `json:"count"`
SuccessCount int `json:"success_count"`
FailureCount int `json:"failure_count"`
MinLatency float64 `json:"min_latency_ms"`
MaxLatency float64 `json:"max_latency_ms"`
AvgLatency float64 `json:"avg_latency_ms"`
P50Latency float64 `json:"p50_latency_ms"`
P95Latency float64 `json:"p95_latency_ms"`
P99Latency float64 `json:"p99_latency_ms"`
UptimePercent float64 `json:"uptime_percent"`
PacketLossAvg float64 `json:"packet_loss_avg,omitempty"`
}
JudgmentSummary aggregates multiple judgments into a time bucket
type RetentionManager ¶
type RetentionManager struct {
// contains filtered or unexported fields
}
RetentionManager handles data retention and cleanup
func NewRetentionManager ¶
func NewRetentionManager(db *CobaltDB, config core.RetentionConfig, dataPath string, logger *slog.Logger) *RetentionManager
NewRetentionManager creates a retention manager
func (*RetentionManager) GetStorageStats ¶
func (rm *RetentionManager) GetStorageStats(ctx context.Context) (*StorageStats, error)
GetStorageStats returns storage statistics including disk usage
func (*RetentionManager) Start ¶
func (rm *RetentionManager) Start()
Start starts the background retention cleanup goroutine
func (*RetentionManager) Stop ¶ added in v0.0.2
func (rm *RetentionManager) Stop()
Stop gracefully stops the retention manager
type StatusPageRepository ¶
type StatusPageRepository struct {
// contains filtered or unexported fields
}
StatusPageRepository implements status page data access
func NewStatusPageRepository ¶
func NewStatusPageRepository(storage *CobaltDB) *StatusPageRepository
NewStatusPageRepository creates a new status page repository
func (*StatusPageRepository) AddIncident ¶ added in v0.1.0
func (r *StatusPageRepository) AddIncident(pageID string, incident core.StatusIncident) error
AddIncident adds an incident to a status page
func (*StatusPageRepository) DeleteStatusPage ¶
func (r *StatusPageRepository) DeleteStatusPage(id string) error
DeleteStatusPage deletes a status page
func (*StatusPageRepository) DeleteSubscription ¶ added in v0.1.0
func (r *StatusPageRepository) DeleteSubscription(subscriptionID string) error
DeleteSubscription removes a subscription
func (*StatusPageRepository) GetIncidentsByPage ¶
func (r *StatusPageRepository) GetIncidentsByPage(pageID string) ([]core.StatusIncident, error)
GetIncidentsByPage retrieves incidents for a status page
func (*StatusPageRepository) GetSoul ¶
func (r *StatusPageRepository) GetSoul(id string) (*core.Soul, error)
GetSoul retrieves a soul by ID
func (*StatusPageRepository) GetSoulJudgments ¶
GetSoulJudgments retrieves recent judgments for a soul
func (*StatusPageRepository) GetStatusPage ¶
func (r *StatusPageRepository) GetStatusPage(id string) (*core.StatusPage, error)
GetStatusPage retrieves a status page by ID
func (*StatusPageRepository) GetStatusPageByDomain ¶
func (r *StatusPageRepository) GetStatusPageByDomain(domain string) (*core.StatusPage, error)
GetStatusPageByDomain retrieves a status page by custom domain
func (*StatusPageRepository) GetStatusPageBySlug ¶
func (r *StatusPageRepository) GetStatusPageBySlug(slug string) (*core.StatusPage, error)
GetStatusPageBySlug retrieves a status page by slug
func (*StatusPageRepository) GetSubscriptionsByPage ¶ added in v0.1.0
func (r *StatusPageRepository) GetSubscriptionsByPage(pageID string) ([]*core.StatusPageSubscription, error)
GetSubscriptionsByPage retrieves all subscriptions for a status page
func (*StatusPageRepository) GetUptimeHistory ¶
GetUptimeHistory retrieves uptime history for a soul
func (*StatusPageRepository) GetWorkspace ¶
func (r *StatusPageRepository) GetWorkspace(id string) (*core.Workspace, error)
GetWorkspace retrieves a workspace by ID
func (*StatusPageRepository) ListStatusPages ¶
func (r *StatusPageRepository) ListStatusPages(workspaceID string) ([]*core.StatusPage, error)
ListStatusPages lists all status pages for a workspace
func (*StatusPageRepository) SaveStatusPage ¶
func (r *StatusPageRepository) SaveStatusPage(page *core.StatusPage) error
SaveStatusPage saves a status page
func (*StatusPageRepository) SaveSubscription ¶ added in v0.1.0
func (r *StatusPageRepository) SaveSubscription(sub *core.StatusPageSubscription) error
SaveSubscription saves a status page subscription
func (*StatusPageRepository) SaveUptimeDay ¶
func (r *StatusPageRepository) SaveUptimeDay(soulID string, day core.UptimeDay) error
SaveUptimeDay saves a day's uptime record
func (*StatusPageRepository) UpdateIncident ¶ added in v0.1.0
func (r *StatusPageRepository) UpdateIncident(pageID string, incidentID string, updates core.StatusIncident) error
UpdateIncident updates an incident on a status page
type StorageStats ¶
type StorageStats struct {
TotalKeys int `json:"total_keys"`
TotalSize int64 `json:"total_size"`
DiskSize int64 `json:"disk_size,omitempty"` // Actual disk usage
DiskFiles int64 `json:"disk_files,omitempty"` // Number of files on disk
KeyCounts map[string]int `json:"key_counts"`
TypeSizes map[string]int64 `json:"type_sizes"`
}
StorageStats holds storage statistics
type TimeResolution ¶
type TimeResolution string
TimeResolution represents different time granularities
const ( ResolutionRaw TimeResolution = "raw" Resolution1Min TimeResolution = "1min" Resolution5Min TimeResolution = "5min" Resolution1Hour TimeResolution = "1hour" Resolution1Day TimeResolution = "1day" )
type TimeSeriesStore ¶
type TimeSeriesStore struct {
// contains filtered or unexported fields
}
TimeSeriesStore provides optimized time-series storage
func NewTimeSeriesStore ¶
func NewTimeSeriesStore(db *CobaltDB, config core.TimeSeriesConfig, logger *slog.Logger) *TimeSeriesStore
NewTimeSeriesStore creates a time-series store
func (*TimeSeriesStore) GetPurityFromSummaries ¶
func (ts *TimeSeriesStore) GetPurityFromSummaries(ctx context.Context, workspaceID, soulID string, window time.Duration) (float64, error)
GetPurityFromSummaries calculates uptime from summaries (faster than raw)
func (*TimeSeriesStore) QuerySummaries ¶
func (ts *TimeSeriesStore) QuerySummaries(ctx context.Context, workspaceID, soulID string, resolution TimeResolution, start, end time.Time) ([]*JudgmentSummary, error)
QuerySummaries retrieves aggregated summaries for a time range
func (*TimeSeriesStore) SaveJudgment ¶
SaveJudgment saves a judgment and updates summaries
func (*TimeSeriesStore) StartCompaction ¶
func (ts *TimeSeriesStore) StartCompaction()
StartCompaction starts the background compaction goroutine