Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlite

package
v2.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Store)

func WithAttemptsRetention added in v2.11.0

func WithAttemptsRetention(maxAge time.Duration, maxRows int) Option

WithAttemptsRetention bounds delivery-attempt history by age and by row count. Both dimensions are optional; zero disables that half.

func WithCheckpointInterval

func WithCheckpointInterval(d time.Duration) Option

func WithDLQRetention

func WithDLQRetention(maxAge time.Duration, maxDepth int) Option

func WithDeliveredRetention

func WithDeliveredRetention(maxAge time.Duration) Option

func WithNowFunc

func WithNowFunc(now func() time.Time) Option

func WithPollInterval

func WithPollInterval(d time.Duration) Option

func WithQueueLimits

func WithQueueLimits(maxDepth int, dropPolicy string) Option

func WithReadOnly added in v2.11.0

func WithReadOnly(readOnly bool) Option

WithReadOnly opens the database read-only: no migrations, no journal or synchronous pragmas, no checkpoint loop.

It exists for processes that inspect another instance's database, such as `hookaido mcp serve --db` with a read-only tool set. Opening read-write there ran `BEGIN IMMEDIATE` migration transactions against the running server's database on every tool request -- so pointing a newer binary's MCP server at an older server's database migrated the schema forward under it, and the older server then failed its downgrade guard at the next restart. Every call also briefly contended for the single write lock with the live server.

func WithRetention

func WithRetention(maxAge, pruneInterval time.Duration) Option

type Store

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

func NewStore

func NewStore(dbPath string, opts ...Option) (*Store, error)

func (*Store) Ack

func (s *Store) Ack(leaseID string) error

func (*Store) AckBatch

func (s *Store) AckBatch(leaseIDs []string) (queue.LeaseBatchResult, error)

func (*Store) CancelMessages

func (*Store) CancelMessagesByFilter

func (s *Store) CancelMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageCancelResponse, error)

func (*Store) CaptureBacklogTrendSample

func (s *Store) CaptureBacklogTrendSample(at time.Time) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) Delete

func (s *Store) Delete(poolName, id string) (bool, error)

func (*Store) DeleteDead

func (*Store) Dequeue

func (s *Store) Dequeue(req queue.DequeueRequest) (queue.DequeueResponse, error)

func (*Store) DequeueContext added in v2.11.0

func (s *Store) DequeueContext(ctx context.Context, req queue.DequeueRequest) (queue.DequeueResponse, error)

DequeueContext is Dequeue with the caller's context honoured: a consumer that has gone away neither keeps a goroutine parked for the rest of max_wait nor receives a lease it can never settle.

func (*Store) Enqueue

func (s *Store) Enqueue(env queue.Envelope) error

func (*Store) EnqueueBatch

func (s *Store) EnqueueBatch(items []queue.Envelope) (int, error)

EnqueueBatch atomically enqueues all items or none (all-or-nothing) in a single transaction. Returns the number of items enqueued and an error.

func (*Store) Extend

func (s *Store) Extend(leaseID string, extendBy time.Duration) error

func (*Store) LeaseRoutes added in v2.11.0

func (s *Store) LeaseRoutes(leaseIDs []string) (map[string]string, error)

LeaseRoutes reports the route each known lease belongs to.

func (*Store) ListAll

func (s *Store) ListAll() ([]secrets.Record, error)

func (*Store) ListAttempts

func (s *Store) ListAttempts(req queue.AttemptListRequest) (queue.AttemptListResponse, error)

func (*Store) ListBacklogTrend

func (*Store) ListByPool

func (s *Store) ListByPool(poolName string) ([]secrets.Record, error)

func (*Store) ListDead

func (s *Store) ListDead(req queue.DeadListRequest) (queue.DeadListResponse, error)

func (*Store) ListMessages

func (s *Store) ListMessages(req queue.MessageListRequest) (queue.MessageListResponse, error)

func (*Store) LookupMessages

func (*Store) MarkDead

func (s *Store) MarkDead(leaseID string, reason string) error

func (*Store) MarkDeadBatch

func (s *Store) MarkDeadBatch(leaseIDs []string, reason string) (queue.LeaseBatchResult, error)

func (*Store) Nack

func (s *Store) Nack(leaseID string, delay time.Duration) error

func (*Store) NackBatch

func (s *Store) NackBatch(leaseIDs []string, delay time.Duration) (queue.LeaseBatchResult, error)

func (*Store) NotifyCh

func (s *Store) NotifyCh() <-chan struct{}

NotifyCh returns a channel that is closed when new items become available. After the channel fires, callers must call NotifyCh again to get the next signal.

func (*Store) RecordAttempt

func (s *Store) RecordAttempt(attempt queue.DeliveryAttempt) error

func (*Store) RequeueDead

func (*Store) RequeueMessages

func (*Store) RequeueMessagesByFilter

func (s *Store) RequeueMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageRequeueResponse, error)

func (*Store) ResumeMessages

func (*Store) ResumeMessagesByFilter

func (s *Store) ResumeMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageResumeResponse, error)

func (*Store) RuntimeMetrics

func (s *Store) RuntimeMetrics() queue.StoreRuntimeMetrics

func (*Store) Stats

func (s *Store) Stats() (queue.Stats, error)

func (*Store) Upsert

func (s *Store) Upsert(rec secrets.Record) error

Upsert inserts or replaces a runtime secret record. Idempotent on (pool_name, id).

Jump to

Keyboard shortcuts

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