InMemoryDocumentStorage
In-memory implementation of DidDocumentStorage.
Uses a Mutex to keep document and metadata changes atomic. Documents are stored in memory and will be lost on application restart.
Use Cases:
Testing and development
Single-instance deployments where persistence is not required
Short-lived operations that don't need to survive restarts
Caching layer for other storage backends
Limitations:
Not persistent across restarts
Limited by available memory
No distributed access (single instance only)
Example Usage:
val storage = InMemoryDocumentStorage()
storage.store(
did = Did("did:key:z6Mk..."),
document = didDocument,
metadata = DidDocumentMetadata(created = Clock.System.now())
)
val (document, metadata) = storage.get(Did("did:key:z6Mk..."))Content copied to clipboard
Functions
Link copied to clipboard
Marks a DID document as deactivated.
Link copied to clipboard
Retrieves a DID document by DID.
Link copied to clipboard
open suspend override fun store(did: Did, document: DidDocument, metadata: DidDocumentMetadata? = null)
Stores a DID document.
Link copied to clipboard
Updates an existing DID document.