nodejs-health-checker-lw
Version:
The main purpose of this package is to substitute nodejs-health-checker package and standardize the liveness and readiness actions for Nodejs applications running in Kubernetes deployments, without adding complexity and extra package installs.
44 lines • 1.08 kB
TypeScript
export interface HealthConfig {
name: string;
version: string;
integrations: Integration[];
}
export interface Integration {
name: string;
handle(): Promise<Check>;
}
export declare class Check {
url?: string;
error?: Error | string | string[] | undefined | null | unknown;
constructor(obj: Check);
}
export interface Liveness {
status: string;
version: string;
}
export interface Readiness {
name: string;
version: string;
status: boolean;
date: Date;
duration: number;
integrations: ReadinessIntegration[];
}
export interface ReadinessIntegration {
name: string;
status: boolean;
response_time: number;
url?: string;
error?: Error | string | string[] | undefined | null | unknown;
}
export declare class HealthChecker implements HealthConfig {
name: string;
version: string;
integrations: Integration[];
constructor(config: HealthConfig);
liveness(): Liveness;
readiness(): Promise<Readiness>;
private check;
private delta;
}
//# sourceMappingURL=index.d.ts.map