Interface ApiXCache

This is the interface to implement to add a Cache to the ApiXManager. This interface requires at least support for a key-value store. If a class implements this interface and it is provided to the ApiXManager, the ApiX will have enhanced security and faster operation.

interface ApiXCache {
    removeValueForKey(key: string): void;
    setValueForKey(value: ApiXCacheValue, key: string, timeToLive?: number): void;
    valueForKey(key: string): undefined | ApiXCacheValue | Promise<(ApiXCacheValue | undefined)>;
}

Implemented by

Methods

  • Removes the value for the specified key. If the key does not exist, the method gracefully fails.

    Parameters

    • key: string

      The key in the store

    Returns void

  • Sets a value from the key in the key-value pair store.

    Parameters

    • value: ApiXCacheValue

      The value to add to the store

    • key: string

      The key in the store

    • OptionaltimeToLive: number

      Time to remove from cache

    Returns void

  • Gets the value from the key-value pair store.

    Parameters

    • key: string

      The key in the store

    Returns undefined | ApiXCacheValue | Promise<(ApiXCacheValue | undefined)>

    value, if it exists in the store