Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / packages/caching/interfaces.ts |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | packages/caching/interfaces.ts |
| Original SHA-256 | 6b1799001d49469262f5cc5c1129e683f286b6ab130642179a122d43f4487efe |
| Git blob SHA | 968cd701bccd608403ac04a29fb99b2db7bb31b9 |
| Reading-copy SHA-256 | 6b1799001d49469262f5cc5c1129e683f286b6ab130642179a122d43f4487efe |
Recovered source transcript
Download complete source text ↓50 lines · 0.9 KB
/**
* Options for cache operations
*/
export interface CacheOptions {
/** Time-to-live in seconds */
ttl?: number
/** Namespace for the cache key */
namespace?: string
}
/**
* Core caching interface that all implementations must follow
*/
export interface CacheInterface {
/**
* Get a value from cache
*/
get<T>(key: string): Promise<T | null>
/**
* Set a value in cache
*/
set<T>(key: string, value: T, options?: CacheOptions): Promise<void>
/**
* Delete a value from cache
*/
delete(key: string): Promise<void>
/**
* Check if a key exists in cache
*/
has(key: string): Promise<boolean>
/**
* Clear all values in cache
*/
clear(): Promise<void>
/**
* Get multiple values from cache
*/
mget<T>(keys: string[]): Promise<(T | null)[]>
/**
* Set multiple values in cache
*/
mset<T>(entries: [string, T][], options?: CacheOptions): Promise<void>
}