Documentation
¶
Index ¶
- type Option
- func WithAttemptsRetention(maxAge time.Duration, maxRows int) Option
- func WithCheckpointInterval(d time.Duration) Option
- func WithDLQRetention(maxAge time.Duration, maxDepth int) Option
- func WithDeliveredRetention(maxAge time.Duration) Option
- func WithNowFunc(now func() time.Time) Option
- func WithPollInterval(d time.Duration) Option
- func WithQueueLimits(maxDepth int, dropPolicy string) Option
- func WithReadOnly(readOnly bool) Option
- func WithRetention(maxAge, pruneInterval time.Duration) Option
- type Store
- func (s *Store) Ack(leaseID string) error
- func (s *Store) AckBatch(leaseIDs []string) (queue.LeaseBatchResult, error)
- func (s *Store) CancelMessages(req queue.MessageCancelRequest) (queue.MessageCancelResponse, error)
- func (s *Store) CancelMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageCancelResponse, error)
- func (s *Store) CaptureBacklogTrendSample(at time.Time) error
- func (s *Store) Close() error
- func (s *Store) Delete(poolName, id string) (bool, error)
- func (s *Store) DeleteDead(req queue.DeadDeleteRequest) (queue.DeadDeleteResponse, error)
- func (s *Store) Dequeue(req queue.DequeueRequest) (queue.DequeueResponse, error)
- func (s *Store) DequeueContext(ctx context.Context, req queue.DequeueRequest) (queue.DequeueResponse, error)
- func (s *Store) Enqueue(env queue.Envelope) error
- func (s *Store) EnqueueBatch(items []queue.Envelope) (int, error)
- func (s *Store) Extend(leaseID string, extendBy time.Duration) error
- func (s *Store) LeaseRoutes(leaseIDs []string) (map[string]string, error)
- func (s *Store) ListAll() ([]secrets.Record, error)
- func (s *Store) ListAttempts(req queue.AttemptListRequest) (queue.AttemptListResponse, error)
- func (s *Store) ListBacklogTrend(req queue.BacklogTrendListRequest) (queue.BacklogTrendListResponse, error)
- func (s *Store) ListByPool(poolName string) ([]secrets.Record, error)
- func (s *Store) ListDead(req queue.DeadListRequest) (queue.DeadListResponse, error)
- func (s *Store) ListMessages(req queue.MessageListRequest) (queue.MessageListResponse, error)
- func (s *Store) LookupMessages(req queue.MessageLookupRequest) (queue.MessageLookupResponse, error)
- func (s *Store) MarkDead(leaseID string, reason string) error
- func (s *Store) MarkDeadBatch(leaseIDs []string, reason string) (queue.LeaseBatchResult, error)
- func (s *Store) Nack(leaseID string, delay time.Duration) error
- func (s *Store) NackBatch(leaseIDs []string, delay time.Duration) (queue.LeaseBatchResult, error)
- func (s *Store) NotifyCh() <-chan struct{}
- func (s *Store) RecordAttempt(attempt queue.DeliveryAttempt) error
- func (s *Store) RequeueDead(req queue.DeadRequeueRequest) (queue.DeadRequeueResponse, error)
- func (s *Store) RequeueMessages(req queue.MessageRequeueRequest) (queue.MessageRequeueResponse, error)
- func (s *Store) RequeueMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageRequeueResponse, error)
- func (s *Store) ResumeMessages(req queue.MessageResumeRequest) (queue.MessageResumeResponse, error)
- func (s *Store) ResumeMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageResumeResponse, error)
- func (s *Store) RuntimeMetrics() queue.StoreRuntimeMetrics
- func (s *Store) Stats() (queue.Stats, error)
- func (s *Store) Upsert(rec secrets.Record) error
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
WithAttemptsRetention bounds delivery-attempt history by age and by row count. Both dimensions are optional; zero disables that half.
func WithCheckpointInterval ¶
func WithDeliveredRetention ¶
func WithNowFunc ¶
func WithPollInterval ¶
func WithQueueLimits ¶
func WithReadOnly ¶ added in v2.11.0
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 ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AckBatch ¶
func (s *Store) AckBatch(leaseIDs []string) (queue.LeaseBatchResult, error)
func (*Store) CancelMessages ¶
func (s *Store) CancelMessages(req queue.MessageCancelRequest) (queue.MessageCancelResponse, error)
func (*Store) CancelMessagesByFilter ¶
func (s *Store) CancelMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageCancelResponse, error)
func (*Store) CaptureBacklogTrendSample ¶
func (*Store) DeleteDead ¶
func (s *Store) DeleteDead(req queue.DeadDeleteRequest) (queue.DeadDeleteResponse, error)
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) EnqueueBatch ¶
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) LeaseRoutes ¶ added in v2.11.0
LeaseRoutes reports the route each known lease belongs to.
func (*Store) ListAttempts ¶
func (s *Store) ListAttempts(req queue.AttemptListRequest) (queue.AttemptListResponse, error)
func (*Store) ListBacklogTrend ¶
func (s *Store) ListBacklogTrend(req queue.BacklogTrendListRequest) (queue.BacklogTrendListResponse, 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 (s *Store) LookupMessages(req queue.MessageLookupRequest) (queue.MessageLookupResponse, error)
func (*Store) MarkDeadBatch ¶
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 (s *Store) RequeueDead(req queue.DeadRequeueRequest) (queue.DeadRequeueResponse, error)
func (*Store) RequeueMessages ¶
func (s *Store) RequeueMessages(req queue.MessageRequeueRequest) (queue.MessageRequeueResponse, error)
func (*Store) RequeueMessagesByFilter ¶
func (s *Store) RequeueMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageRequeueResponse, error)
func (*Store) ResumeMessages ¶
func (s *Store) ResumeMessages(req queue.MessageResumeRequest) (queue.MessageResumeResponse, error)
func (*Store) ResumeMessagesByFilter ¶
func (s *Store) ResumeMessagesByFilter(req queue.MessageManageFilterRequest) (queue.MessageResumeResponse, error)
func (*Store) RuntimeMetrics ¶
func (s *Store) RuntimeMetrics() queue.StoreRuntimeMetrics