memory

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdempotencyStore

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

func NewIdempotencyStore

func NewIdempotencyStore(ttl time.Duration) *IdempotencyStore

func NewIdempotencyStoreWithLimit

func NewIdempotencyStoreWithLimit(ttl time.Duration, maxEntries int) *IdempotencyStore

func (*IdempotencyStore) Begin

func (s *IdempotencyStore) Begin(key, reqHash, method, path string) (fh.IdempotencyDecision, *fh.IdempotencyRecord, error)

func (*IdempotencyStore) Close

func (s *IdempotencyStore) Close() error

func (*IdempotencyStore) Complete

func (s *IdempotencyStore) Complete(key, reqHash string, status int, contentType string, headers map[string][]string, response []byte) error

func (*IdempotencyStore) PurgeExpired

func (s *IdempotencyStore) PurgeExpired(ctx context.Context, now time.Time) (int, error)

type JournalStore

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

func (*JournalStore) Append

func (*JournalStore) Close

func (s *JournalStore) Close() error

func (*JournalStore) Entries

func (s *JournalStore) Entries() []fh.RequestJournalEntry

type QueueStorage

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

func NewQueueStorage

func NewQueueStorage() *QueueStorage

func NewQueueStorageWithLimit

func NewQueueStorageWithLimit(maxEntries int) *QueueStorage

func (*QueueStorage) Claim

func (s *QueueStorage) Claim(ctx context.Context, now time.Time) (*fh.QueueJob, error)

func (*QueueStorage) Close

func (s *QueueStorage) Close() error

func (*QueueStorage) Complete

func (s *QueueStorage) Complete(ctx context.Context, job *fh.QueueJob) error

func (*QueueStorage) DiscardFailed

func (s *QueueStorage) DiscardFailed(ctx context.Context, id string) error

func (*QueueStorage) Enqueue

func (s *QueueStorage) Enqueue(ctx context.Context, job *fh.QueueJob) error

func (*QueueStorage) Fail

func (s *QueueStorage) Fail(ctx context.Context, job *fh.QueueJob, cause error) error

func (*QueueStorage) ListJobs

func (s *QueueStorage) ListJobs(ctx context.Context, state string, limit int) ([]fh.QueueJobSnapshot, error)

func (*QueueStorage) PurgeJobs

func (s *QueueStorage) PurgeJobs(ctx context.Context, state string, before time.Time, limit int) (int, error)

func (*QueueStorage) Recover

func (s *QueueStorage) Recover(ctx context.Context) error

func (*QueueStorage) RequeueFailed

func (s *QueueStorage) RequeueFailed(ctx context.Context, id string) error

func (*QueueStorage) Retry

func (s *QueueStorage) Retry(ctx context.Context, job *fh.QueueJob, cause error, backoff time.Duration) error

func (*QueueStorage) Stats

func (s *QueueStorage) Stats(ctx context.Context) (fh.QueueStats, error)

type Store

type Store struct {
	Journal     *JournalStore
	Idempotency *IdempotencyStore
	Queue       *QueueStorage
}

Store groups process-local reliability adapters. Use New().Journal, New().Idempotency and New().Queue in fh.ReliabilityConfig. These adapters are non-distributed and intentionally simple for tests, benchmarks and embedded use.

func New

func New() *Store

func NewWithConfig

func NewWithConfig(cfg StoreConfig) *Store

type StoreConfig

type StoreConfig struct {
	MaxIdempotencyEntries int
	MaxQueueEntries       int
}

Jump to

Keyboard shortcuts

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