sqlitestore

package
v0.141.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package sqlitestore is a small file-backed reference adapter for lifecycle conformance and host examples. It serializes management metadata in one SQLite row; high-volume hosts should implement the same contract with normalized tables. It is never installed by DataModule automatically. Providers/targets must still implement fencing, physical recovery and their own retention/cleanup policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	RetryWindow      time.Duration
	ReceiptRetention time.Duration
	Now              func() time.Time
}

type Store

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

func Open

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

func (*Store) Acquire

func (s *Store) Acquire(ctx context.Context, id string, target data.TargetKey, ttl time.Duration) (data.Lease, error)

func (*Store) AcquireRecovery

func (s *Store) AcquireRecovery(ctx context.Context, id string, target data.TargetKey, ttl time.Duration) (data.Lease, error)

func (*Store) BeginIntent

func (s *Store) BeginIntent(ctx context.Context, l data.Lease, intent data.Intent, revision uint64) error

func (*Store) Capabilities

func (*Store) Capabilities() data.StoreCapabilities

func (*Store) CheckCleanup

func (s *Store) CheckCleanup(ctx context.Context, lease data.Lease, stageID string) error

func (*Store) CheckLease

func (s *Store) CheckLease(ctx context.Context, l data.Lease) error

func (*Store) Claim

func (s *Store) Claim(ctx context.Context, op data.Operation) (out data.Claim, err error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) EndPreviewRecord added in v0.139.3

func (s *Store) EndPreviewRecord(ctx context.Context, id, state string) error

func (*Store) GetArtifact

func (s *Store) GetArtifact(ctx context.Context, provider, id string) (out data.ArtifactRef, err error)

func (*Store) GetOperation

func (s *Store) GetOperation(ctx context.Context, id string) (out data.Operation, err error)

func (*Store) GetReceipt

func (s *Store) GetReceipt(ctx context.Context, id string) (out data.PreparationReceipt, err error)

func (*Store) InspectPreviewRecord added in v0.139.3

func (s *Store) InspectPreviewRecord(ctx context.Context, w data.PreviewRecord) error

func (*Store) ListOperations

func (s *Store) ListOperations(ctx context.Context, target data.TargetKey, limit int) (out []data.Operation, err error)

func (*Store) ListReceipts added in v0.139.1

func (s *Store) ListReceipts(ctx context.Context, target data.TargetKey, query data.ReceiptQuery) (out data.ReceiptPage, err error)

func (*Store) LookupPreviewRecord added in v0.139.3

func (s *Store) LookupPreviewRecord(ctx context.Context, id string) (out data.PreviewRecord, err error)

func (*Store) LookupRequest added in v0.139.1

func (s *Store) LookupRequest(ctx context.Context, request data.RequestKey) (out data.Operation, found bool, err error)

func (*Store) OpenPreviewRecord added in v0.139.3

func (s *Store) OpenPreviewRecord(ctx context.Context, w data.PreviewRecord, quota int) (out data.PreviewRecord, err error)

func (*Store) Prune

func (s *Store) Prune(ctx context.Context) error

Prune protects active/pending/rollback receipts and nonterminal operations. It never deletes target generations or fence counters. Expired operation claims retain tombstones through RetryWindow, preventing a duplicate effect on retry.

func (*Store) PrunePreviewRecords added in v0.139.3

func (s *Store) PrunePreviewRecords(ctx context.Context, limit int) error

func (*Store) PutReceipt

func (s *Store) PutReceipt(ctx context.Context, l data.Lease, r data.PreparationReceipt) error

func (*Store) PutVerification

func (s *Store) PutVerification(ctx context.Context, l data.Lease, id string, contentRev uint64, v data.VerificationResult) (out data.PreparationReceipt, err error)

func (*Store) Release

func (s *Store) Release(ctx context.Context, l data.Lease) error

func (*Store) Renew

func (s *Store) Renew(ctx context.Context, l data.Lease, ttl time.Duration) (out data.Lease, err error)

func (*Store) RequestCancel

func (s *Store) RequestCancel(ctx context.Context, id string, rev uint64) (out data.Operation, err error)

func (*Store) ResolveIntent

func (s *Store) ResolveIntent(ctx context.Context, l data.Lease, intent data.Intent, observation data.Observation, next data.Operation, rev uint64) (out data.Operation, err error)

func (*Store) Save

func (s *Store) Save(ctx context.Context, next data.Operation, rev uint64, l *data.Lease) (out data.Operation, err error)

func (*Store) Target

func (s *Store) Target(ctx context.Context, target data.TargetKey) (out data.TargetState, err error)

Jump to

Keyboard shortcuts

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