Create a new storage.
a factory function for creating new streams. Note that the stream is fully managed while stored.
configuration options.
DefaultStorageOptions for configuration details.
Readonly
createa factory function for creating new streams. Note that the stream is fully managed while stored.
Get a cache key from a given Context. Useful when context object is rich
and not unique, but a sub-property of it (e.g. context.path
) uniquely
represents the cached value.
Typically a file path, but could be an arbitrary object.
An arbitrary string or object to be used as a key for an Map
Put managed stream into the storage.
Entry to be stored.
Context reference.
Remove managed stream from the storage. Called when managed stream gets destroyed.
Entry to be removed.
A context reference that was provided to put()
.
Take stored stream out of the storage (and remove it). The returned entry
MUST have an entry.offset
less or equal to startOffset
.
Ideally, it should be as close as possible to startOffset
.
Starting offset into the stream.
A context reference that was provided to put()
.
Stored entry or undefined
.
A sensible (if not optimized) default storage implementation for the
RangeFinder
class.Available features:
See
RangeFinder for details.