Documentation
¶
Index ¶
- type Options
- type Store
- func (s *Store) AcquireLock(ctx context.Context, key string, ttl time.Duration) (bool, func() error, error)
- 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) Ping(ctx context.Context) 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
}
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 (ADR-0020) via SET NX with a TTL: the first caller across all processes claims the key with a unique token and gets acquired=true; concurrent callers get false. release runs a token-checked Lua delete so only the current holder unlocks. The TTL guarantees a crashed holder cannot wedge the key. The caller (the stampede wrapper) supplies an already-namespaced key.
func (*Store) InvalidateTags ¶
Click to show internal directories.
Click to hide internal directories.