ProtoRune. Atproto. Identity. Cache
(proto_rune v0.2.0)
Copy Markdown
Provides caching for AT Protocol identity resolution results.
This module maintains two ETS tables:
- handle_cache: Maps handles to DIDs with TTL
- did_cache: Stores DID documents with TTL
The cache automatically expires entries and provides concurrent access with proper cleanup.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets a cached DID for a handle. Returns {:ok, did} if found and not expired, otherwise {:error, reason}.
Gets a cached DID document. Returns {:ok, doc} if found and not expired, otherwise {:error, reason}.
Invalidates cached data for a DID.
Invalidates cached data for a handle.
Stores a handle -> DID mapping in the cache.
Stores a DID document in the cache.
Returns cache statistics.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Gets a cached DID for a handle. Returns {:ok, did} if found and not expired, otherwise {:error, reason}.
Gets a cached DID document. Returns {:ok, doc} if found and not expired, otherwise {:error, reason}.
@spec invalidate_did(String.t()) :: :ok
Invalidates cached data for a DID.
@spec invalidate_handle(String.t()) :: :ok
Invalidates cached data for a handle.
Stores a handle -> DID mapping in the cache.
Stores a DID document in the cache.
@spec stats() :: map()
Returns cache statistics.