@evlt/apix
    Preparing search index...

    Interface Cache

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

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

    Implemented by

    Index

    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: CacheValue

        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 | CacheValue | Promise<(CacheValue | undefined)>

      value, if it exists in the store