UNPKG

@stolostron/multicluster-sdk

Version:

Provides extensions and APIs that dynamic plugins can use to leverage multicluster capabilities provided by Red Hat Advanced Cluster Management.

29 lines 1.23 kB
/** * Cache for fleet resources. * The key is the request path, and the value is the resource data. */ export declare const fleetResourceCache: Record<string, any>; /** * Cache for fleet WebSockets. * The key is a cache key generated by getCacheKey, and the value is the WebSocket instance. */ export declare const fleetSocketCache: Record<string, WebSocket>; /** * Generates a cache key for a given resource. * @param model - The Kubernetes model for the resource. * @param cluster - The name of the cluster. * @param namespace - The namespace of the resource. * @param name - The name of the resource. * @returns A unique cache key string. */ export declare const getCacheKey: ({ model, cluster, namespace, name, }: { model: any; cluster?: string; namespace?: string; name?: string; }) => string; /** * Clears the cache for fleet resources and closes any open WebSockets. */ export declare function clearFleetK8sWatchResourceCache(): void; export declare const handleWebsocketEvent: <R>(event: any, requestPath: string, setData: (data: R) => void, isList: boolean | undefined, fleetResourceCache: Record<string, any>, cluster: string) => void; //# sourceMappingURL=fleetK8sWatchResource.d.ts.map