Class CacheAbstract

Abstract interface class for a cached object.

Hierarchy

Constructors

Methods

  • Decrement a key in the cache by a given amount.

    Parameters

    • key: string
    • Optional amount: number

    Returns Awaitable<undefined | number>

  • Fetch a value from the cache by its key.

    Returns

    Promise<any|undefined>

    Parameters

    • key: string

    Returns Awaitable<undefined | string>

  • Increment a key in the cache by a given amount.

    Parameters

    • key: string
    • Optional amount: number

    Returns Awaitable<undefined | number>

  • Store the given value in the cache by key.

    Parameters

    • key: string
    • value: string
    • Optional expires: Date

    Returns Awaitable<void>

  • Fetch a value from the cache by its key as a Safe value.

    Parameters

    • key: string

    Returns Promise<Safe>