Class CacheLoader<K, V>Abstract

Cache class allowing to create caches with automatic cache loading and delegates.

Type Parameters

  • K extends Object

  • V extends Object

Hierarchy

  • BaseCacheLoader<K, V>
    • CacheLoader

Constructors

  • Constructor.

    Type Parameters

    • K extends Object

    • V extends Object

    Parameters

    • cacheId: string

      the identifier of the cache

    • options: CacheOptions = {}

      the cache options:

    Returns CacheLoader<K, V>

Properties

isCacheable: boolean

Methods

  • Parameters

    • metadata: CacheMetadata

    Returns void

  • Deletes a cache entry for a given key.

    Parameters

    • key: K

    Returns Promise<void>

  • Parameters

    • value: any

    Returns V

  • Checks if a cache entry exists for a given key.

    Parameters

    • key: K

    Returns Promise<boolean>

    true if the entry exists in the cache, false otherwise

  • Gets a cached value.

    Parameters

    • key: K

      the cache key

    • force: boolean = false

      whether to force the cache refresh for that key (default: false)

    Returns Promise<V>

    the cached value

  • Returns string

  • Gets a cached value with additional metadata.

    Parameters

    • key: K

      the cache key

    • force: boolean = false

      whether to force the cache refresh for that key (default: false)

    Returns Promise<Metadata<V>>

    the cached value

  • Parameters

    • key: K

    Returns string

  • Parameters

    • key: K

    Returns Promise<V>

  • Deletes all entries in the cache;

    Returns Promise<void>

  • Parameters

    • value: V

    Returns any

  • Parameters

    • key: K
    • value: V

    Returns Promise<void>

Generated using TypeDoc