-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from nestjs/6.0.0
6.0.0
- Loading branch information
Showing
25 changed files
with
657 additions
and
642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...alth-indicators/typeorm/typeorm.health.ts → ...lth-indicators/database/typeorm.health.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { HealthIndicatorResult } from '..'; | ||
|
||
/** | ||
* Represents an abstract health indicator | ||
* with common functionalities | ||
* | ||
* @public | ||
*/ | ||
export abstract class HealthIndicator { | ||
/** | ||
* Generates the health indicator result object | ||
* @param key The key which will be used as key for the result object | ||
* @param isHealthy Whether the health indicator is healthy | ||
* @param data Additional data which will get appended to the result object | ||
* | ||
* @example | ||
* class MyHealthIndicator extends HealthIndicator { | ||
* public check(key: string) { | ||
* // Replace with the actual check | ||
* const isHealthy = true; | ||
* // Returns { [key]: { status: 'up', message: 'Up and running' } } | ||
* return super.getStatus(key, isHealthy, { message: 'Up and running' }); | ||
* } | ||
* } | ||
*/ | ||
protected getStatus( | ||
key: string, | ||
isHealthy: boolean, | ||
data?: { [key: string]: unknown }, | ||
): HealthIndicatorResult { | ||
return { | ||
[key]: { | ||
status: isHealthy ? 'up' : 'down', | ||
...data, | ||
}, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './typeorm/typeorm.health'; | ||
export * from './dns/dns.health'; | ||
export * from './mongoose/mongoose.health'; | ||
export * from './database/mongoose.health'; | ||
export * from './database/typeorm.health'; | ||
export * from './microservice/microservice.health'; | ||
export * from './health-indicator'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.