Documentation
¶
Index ¶
- type Store
- func (s *Store) AcquireLock(ctx context.Context, key string, ttl time.Duration) (bool, func() error, error)
- func (s *Store) Close()
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Get(ctx context.Context, key string) ([]byte, error)
- func (s *Store) InvalidateTags(ctx context.Context, tags ...string) error
- func (s *Store) Set(ctx context.Context, key string, val []byte, ttl time.Duration, tags ...string) 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
}
It supports tag-based invalidation via a reverse-index and is thread-safe.
func (*Store) AcquireLock ¶ added in v1.2.0
func (s *Store) AcquireLock(ctx context.Context, key string, ttl time.Duration) (bool, func() error, error)
AcquireLock implements quark.CacheLocker — a non-blocking, per-key, TTL-bounded try-lock (ADR-0020). Exactly one caller gets acquired=true and a release func; others get false until release or expiry. In a single process the lock is degenerate (no real cross-instance race), but the contract is honoured so the stampede wrapper's coordination path is exercisable in-process.
func (*Store) Close ¶
func (s *Store) Close()
Close stops the background cleanup goroutine and releases resources.
func (*Store) InvalidateTags ¶
Click to show internal directories.
Click to hide internal directories.