store

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidHistoryCursor = errors.New("invalid history cursor")

Functions

This section is empty.

Types

type RuntimeCheckpoint

type RuntimeCheckpoint struct {
	Payload         []byte
	LastReportRowID int64
	UpdatedAt       time.Time
}

type SQLite

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

func Open

func Open(path string, retention time.Duration) (*SQLite, error)

func (*SQLite) Close

func (s *SQLite) Close() error

func (*SQLite) EdgeHistory

func (s *SQLite) EdgeHistory(ctx context.Context, edgeID string, since time.Time) (domain.EdgeHistory, error)

func (*SQLite) EdgeHistoryWindow

func (s *SQLite) EdgeHistoryWindow(ctx context.Context, edgeID string, window domain.HistoryWindow, to time.Time) (domain.EdgeHistory, bool, error)

func (*SQLite) HistoryEdges

func (s *SQLite) HistoryEdges(ctx context.Context, query domain.HistoryEdgeQuery, to time.Time) (domain.HistoryEdgePage, error)

func (*SQLite) HistoryNodes

func (s *SQLite) HistoryNodes(ctx context.Context, window domain.HistoryWindow, to time.Time) (domain.HistoryNodes, error)

func (*SQLite) Maintain

func (s *SQLite) Maintain(ctx context.Context, now time.Time) error

func (*SQLite) Record

func (s *SQLite) Record(
	ctx context.Context,
	report domain.ReportEnvelope,
	receivedAt time.Time,
	runtimeState []byte,
	traffic []domain.AcceptedTraffic,
	transitions []domain.PathTransition,
) (bool, error)

func (*SQLite) RecordWithMetadata

func (s *SQLite) RecordWithMetadata(
	ctx context.Context,
	report domain.ReportEnvelope,
	receivedAt time.Time,
	runtimeState []byte,
	traffic []domain.AcceptedTraffic,
	transitions []domain.PathTransition,
	metadata *domain.HistoryMetadata,
) (bool, error)

func (*SQLite) RestoreCheckpoint

func (s *SQLite) RestoreCheckpoint(ctx context.Context) (RuntimeCheckpoint, error)

func (*SQLite) RestoreReports

func (s *SQLite) RestoreReports(ctx context.Context) ([]StoredReport, error)

func (*SQLite) RestoreReportsAfter

func (s *SQLite) RestoreReportsAfter(ctx context.Context, lastReportRowID int64) ([]StoredReport, error)

func (*SQLite) RestoreState

func (s *SQLite) RestoreState(ctx context.Context) ([]byte, error)

func (*SQLite) Retention

func (s *SQLite) Retention() time.Duration

func (*SQLite) SaveCheckpoint

func (s *SQLite) SaveCheckpoint(ctx context.Context, payload []byte, lastReportRowID int64, updatedAt time.Time) error

func (*SQLite) SaveHistoryMetadata

func (s *SQLite) SaveHistoryMetadata(ctx context.Context, metadata domain.HistoryMetadata, updatedAt time.Time) error

func (*SQLite) SaveState

func (s *SQLite) SaveState(ctx context.Context, payload []byte, updatedAt time.Time) error

type StoredReport

type StoredReport struct {
	RowID      int64
	Report     domain.ReportEnvelope
	ReceivedAt time.Time
}

Jump to

Keyboard shortcuts

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