Beignet API reference
    Preparing search index...

    Extended cache port interface that includes the Redis client. The Redis provider adds the underlying client for advanced operations.

    interface RedisCachePort {
        client: Redis;
        delete(key: string): Promise<boolean>;
        get(key: string): Promise<string | null>;
        has(key: string): Promise<boolean>;
        remember(
            key: string,
            factory: () => Promise<string>,
            options?: CacheSetOptions,
        ): Promise<string>;
        set(key: string, value: string, options?: CacheSetOptions): Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Methods

    Properties

    client: Redis

    The underlying Redis client instance. Use this for advanced operations not covered by the cache interface.

    Methods

    • Delete a cache key.

      Parameters

      • key: string

      Returns Promise<boolean>

      true when the key existed.

    • Return a fresh value for key, or null when missing or expired.

      Parameters

      • key: string

      Returns Promise<string | null>

    • Return whether a fresh value exists for key.

      Parameters

      • key: string

      Returns Promise<boolean>

    • Return a cached value or compute, store, and return a new value.

      Implementations are not required to provide single-flight behavior. If concurrent cache fills matter, choose an adapter that documents that guarantee or protect the factory at the application layer.

      Parameters

      Returns Promise<string>

    • Store a string value.

      Parameters

      Returns Promise<void>