Documentation
¶
Overview ¶
Package sqlite provides the batteries-included durable Store (modernc.org/sqlite — pure Go, no cgo, per ADR-0006). It passes the same exported conformance suite as the memory backend.
Index ¶
- type Store
- func (s *Store) AdmitSubmission(ctx context.Context, sub harness.Submission) (harness.Submission, error)
- func (s *Store) AppendRecords(ctx context.Context, conversationID string, recs []harness.Record) error
- func (s *Store) CancelSubmission(ctx context.Context, submissionID, reason string) (wasRunning bool, err error)
- func (s *Store) ClaimSubmission(ctx context.Context, claim harness.SubmissionClaim) (harness.Submission, error)
- func (s *Store) Close() error
- func (s *Store) EnsureConversation(ctx context.Context, candidate harness.Conversation) (harness.Conversation, bool, error)
- func (s *Store) FinalizeSettlement(ctx context.Context, submissionID string) error
- func (s *Store) GetAttachment(ctx context.Context, digest string) (harness.Attachment, error)
- func (s *Store) GetConversation(ctx context.Context, key harness.SessionKey) (harness.Conversation, error)
- func (s *Store) GetSubmission(ctx context.Context, id string) (harness.Submission, error)
- func (s *Store) ListAttempts(ctx context.Context, submissionID string) ([]harness.Attempt, error)
- func (s *Store) ListByStatus(ctx context.Context, status harness.SubmissionStatus) ([]harness.Submission, error)
- func (s *Store) ListChildSubmissions(ctx context.Context, parentSubmissionID string) ([]harness.Submission, error)
- func (s *Store) ListExpiredLeases(ctx context.Context, now time.Time) ([]harness.Submission, error)
- func (s *Store) ListExpiredWaits(ctx context.Context, now time.Time) ([]harness.Submission, error)
- func (s *Store) ListRunnable(ctx context.Context) ([]harness.Submission, error)
- func (s *Store) PutAttachment(ctx context.Context, mediaType string, data []byte) (harness.AttachmentRef, error)
- func (s *Store) ReadRecords(ctx context.Context, conversationID string, afterID string) ([]harness.Record, error)
- func (s *Store) ReleaseSubmission(ctx context.Context, release harness.SubmissionRelease) error
- func (s *Store) RenewLease(ctx context.Context, renewal harness.LeaseRenewal) error
- func (s *Store) ReserveSettlement(ctx context.Context, submissionID, attemptID string) error
- func (s *Store) ResumeSubmission(ctx context.Context, submissionID string) error
- func (s *Store) StartAttempt(ctx context.Context, attempt harness.Attempt) error
- func (s *Store) WaitSubmission(ctx context.Context, wait harness.SubmissionWait) error
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 is the SQLite implementation of harness.Store.
func Open ¶
Open opens (creating if needed) the database at path and verifies the schema version. When path is an existing directory, the database file is "harness.db" inside it.
func (*Store) AdmitSubmission ¶
func (s *Store) AdmitSubmission(ctx context.Context, sub harness.Submission) (harness.Submission, error)
AdmitSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) AppendRecords ¶
func (s *Store) AppendRecords(ctx context.Context, conversationID string, recs []harness.Record) error
AppendRecords implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) CancelSubmission ¶ added in v0.6.0
func (s *Store) CancelSubmission(ctx context.Context, submissionID, reason string) (wasRunning bool, err error)
CancelSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ClaimSubmission ¶
func (s *Store) ClaimSubmission(ctx context.Context, claim harness.SubmissionClaim) (harness.Submission, error)
ClaimSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) EnsureConversation ¶
func (s *Store) EnsureConversation(ctx context.Context, candidate harness.Conversation) (harness.Conversation, bool, error)
EnsureConversation implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) FinalizeSettlement ¶
FinalizeSettlement implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) GetAttachment ¶
GetAttachment implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) GetConversation ¶
func (s *Store) GetConversation(ctx context.Context, key harness.SessionKey) (harness.Conversation, error)
GetConversation implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) GetSubmission ¶
GetSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ListAttempts ¶
ListAttempts implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ListByStatus ¶
func (s *Store) ListByStatus(ctx context.Context, status harness.SubmissionStatus) ([]harness.Submission, error)
ListByStatus implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ListChildSubmissions ¶ added in v0.6.0
func (s *Store) ListChildSubmissions(ctx context.Context, parentSubmissionID string) ([]harness.Submission, error)
ListChildSubmissions implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ListExpiredLeases ¶
ListExpiredLeases implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ListExpiredWaits ¶ added in v0.6.0
ListExpiredWaits implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ListRunnable ¶
ListRunnable implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) PutAttachment ¶
func (s *Store) PutAttachment(ctx context.Context, mediaType string, data []byte) (harness.AttachmentRef, error)
PutAttachment implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ReadRecords ¶
func (s *Store) ReadRecords(ctx context.Context, conversationID string, afterID string) ([]harness.Record, error)
ReadRecords implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ReleaseSubmission ¶
ReleaseSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) RenewLease ¶
RenewLease implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ReserveSettlement ¶
ReserveSettlement implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) ResumeSubmission ¶ added in v0.6.0
ResumeSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) StartAttempt ¶
StartAttempt implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.
func (*Store) WaitSubmission ¶ added in v0.6.0
WaitSubmission implements the corresponding harness.Store method; semantics are specified on the contract and pinned by the conformance suite.