Class: AtprotoAuth::Storage::Interface
- Inherits:
-
Object
- Object
- AtprotoAuth::Storage::Interface
- Defined in:
- lib/atproto_auth/storage/interface.rb
Overview
Base storage interface that all implementations must conform to
Instance Method Summary collapse
-
#acquire_lock(key, ttl:) ⇒ Boolean
Acquire a lock.
-
#delete(key) ⇒ Boolean
Delete a value.
-
#exists?(key) ⇒ Boolean
Check if key exists.
-
#get(key) ⇒ Object?
Retrieve a value.
-
#multi_get(keys) ⇒ Hash<String, Object>
Get multiple values.
-
#multi_set(hash, ttl: nil) ⇒ Boolean
Store multiple values.
-
#release_lock(key) ⇒ Boolean
Release a lock.
-
#set(key, value, ttl: nil) ⇒ Boolean
Store a value with optional TTL.
-
#with_lock(key, ttl: 30) { ... } ⇒ Object
Execute block with lock.
Instance Method Details
#acquire_lock(key, ttl:) ⇒ Boolean
Acquire a lock
63 64 65 |
# File 'lib/atproto_auth/storage/interface.rb', line 63 def acquire_lock(key, ttl:) raise NotImplementedError end |
#delete(key) ⇒ Boolean
Delete a value
29 30 31 |
# File 'lib/atproto_auth/storage/interface.rb', line 29 def delete(key) raise NotImplementedError end |
#exists?(key) ⇒ Boolean
Check if key exists
37 38 39 |
# File 'lib/atproto_auth/storage/interface.rb', line 37 def exists?(key) raise NotImplementedError end |
#get(key) ⇒ Object?
Retrieve a value
21 22 23 |
# File 'lib/atproto_auth/storage/interface.rb', line 21 def get(key) raise NotImplementedError end |
#multi_get(keys) ⇒ Hash<String, Object>
Get multiple values
45 46 47 |
# File 'lib/atproto_auth/storage/interface.rb', line 45 def multi_get(keys) raise NotImplementedError end |
#multi_set(hash, ttl: nil) ⇒ Boolean
Store multiple values
54 55 56 |
# File 'lib/atproto_auth/storage/interface.rb', line 54 def multi_set(hash, ttl: nil) raise NotImplementedError end |
#release_lock(key) ⇒ Boolean
Release a lock
71 72 73 |
# File 'lib/atproto_auth/storage/interface.rb', line 71 def release_lock(key) raise NotImplementedError end |
#set(key, value, ttl: nil) ⇒ Boolean
Store a value with optional TTL
13 14 15 |
# File 'lib/atproto_auth/storage/interface.rb', line 13 def set(key, value, ttl: nil) raise NotImplementedError end |
#with_lock(key, ttl: 30) { ... } ⇒ Object
Execute block with lock
81 82 83 |
# File 'lib/atproto_auth/storage/interface.rb', line 81 def with_lock(key, ttl: 30) raise NotImplementedError end |