sqlite

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store persists runs and events in SQLite.

func Open

func Open(path string) (*Store, error)

Open opens (or creates) a SQLite database at path and applies the schema.

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying database.

func (*Store) EnsureRun

func (s *Store) EnsureRun(run *model.Run) error

EnsureRun upserts the run header/JSON snapshot.

func (*Store) LastRunID

func (s *Store) LastRunID(project string) (string, error)

LastRunID returns the most recent run id, optionally filtered by project.

func (*Store) ListProjectRuns

func (s *Store) ListProjectRuns(project string, limit int) ([]string, error)

ListProjectRuns returns run IDs for a project, newest first.

func (*Store) LoadRun

func (s *Store) LoadRun(runID string) (*model.Run, error)

LoadRun loads a run by ID (from the run_json snapshot).

func (*Store) LoadRunFromEvents

func (s *Store) LoadRunFromEvents(runID string) (*model.Run, error)

LoadRunFromEvents rebuilds derived state by replaying stored events in order.

func (*Store) SuccessfulDurations

func (s *Store) SuccessfulDurations(project string, limit int) ([]time.Duration, error)

SuccessfulDurations returns wall-clock durations for recent successful runs (EndedAt set and no service in PhaseFailed). Newest-last order for Stats.Last.

func (*Store) WriteEvent

func (s *Store) WriteEvent(run *model.Run, ev model.Event) error

WriteEvent appends one event and refreshes the run snapshot.

func (*Store) WriteLog

func (s *Store) WriteLog(runID, containerID, service, line string, ts time.Time) error

WriteLog appends a log line row.

func (*Store) WriteProbeResult

func (s *Store) WriteProbeResult(runID, service, probeType, target, detail string, success bool, ts time.Time) error

WriteProbeResult appends a probe result row.

func (*Store) WriteResourceSample

func (s *Store) WriteResourceSample(runID, containerID string, ts time.Time, cpu float64, memUsage, memLimit uint64) error

WriteResourceSample appends a resource sample row.

Jump to

Keyboard shortcuts

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