@solapi/mcp-server
Version:
MCP server for SOLAPI document search and integration
84 lines • 2.6 kB
TypeScript
/**
* @file 예제 데이터 캐시 관리자
* @description 예제 데이터를 메모리에 캐시하여 성능을 향상시킵니다.
* LRU와 TTL 전략을 적용한 효율적인 캐시 시스템입니다.
*/
import type { Example } from '../types';
export declare class SdkCacheManager {
private static instance;
private readonly maxLibraryCacheSize;
private readonly maxSearchCacheSize;
private readonly maxCategoryCacheSize;
private readonly searchCacheTTL;
private cache;
private searchCache;
private categoryCache;
private constructor();
static getInstance(): SdkCacheManager;
/**
* 캐시 항목이 만료되었는지 확인
*/
private isExpired;
/**
* LRU 방식으로 캐시 크기 관리 (가장 오래된 항목 제거)
*/
private enforceLRULimit;
/**
* 검색 캐시에서 만료된 항목들 정리
*/
private cleanupExpiredSearchCache;
/**
* 라이브러리별 예제 데이터를 캐시에 저장 (LRU 전략 적용)
*/
setLibraryCache(libraryName: string, examples: Example[]): void;
/**
* 캐시된 라이브러리 예제 데이터 반환
*/
getLibraryCache(libraryName: string): Example[] | undefined;
/**
* 검색 결과 캐시 저장 (TTL 전략 적용)
*/
setSearchCache(query: string, results: Example[]): void;
/**
* 검색 결과 캐시 반환 (TTL 체크)
*/
getSearchCache(query: string): Example[] | undefined;
/**
* 카테고리별 예제 캐시 저장 (LRU 전략 적용)
*/
setCategoryCache(category: string, examples: Example[]): void;
/**
* 카테고리별 예제 캐시 반환
*/
getCategoryCache(category: string): Example[] | undefined;
/**
* 모든 캐시 초기화
*/
clearAll(): void;
/**
* 특정 라이브러리 캐시만 초기화
*/
clearLibraryCache(libraryName: string): void;
/**
* 캐시 통계 정보 반환 (만료된 항목 제외)
*/
getCacheStats(): {
libraryCount: number;
searchCount: number;
categoryCount: number;
totalMemoryUsage: number;
};
/**
* 캐시 성능 정보 반환
*/
getCachePerformanceInfo(): {
maxLibraryCacheSize: number;
maxSearchCacheSize: number;
maxCategoryCacheSize: number;
searchCacheTTL: number;
libraryCacheUtilization: number;
searchCacheUtilization: number;
categoryCacheUtilization: number;
};
}
//# sourceMappingURL=sdkCacheManager.d.ts.map