-
Notifications
You must be signed in to change notification settings - Fork 801
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added MySQL HealthChecks Query and Callback support. (#1835)
- Loading branch information
Showing
5 changed files
with
165 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Diagnostics.HealthChecks; | ||
using MySqlConnector; | ||
|
||
namespace HealthChecks.MySql; | ||
|
||
/// <summary> | ||
/// Options for <see cref="MySqlHealthCheck"/>. | ||
/// </summary> | ||
public class MySqlHealthCheckOptions | ||
{ | ||
/// <summary> | ||
/// The MySQL connection string to be used. | ||
/// </summary> | ||
public string ConnectionString { get; set; } = null!; | ||
|
||
/// <summary> | ||
/// The query to be executed. | ||
/// </summary> | ||
public string CommandText { get; set; } = MySqlHealthCheckBuilderExtensions.HEALTH_QUERY; | ||
|
||
/// <summary> | ||
/// An optional action executed before the connection is opened in the health check. | ||
/// </summary> | ||
public Action<MySqlConnection>? Configure { get; set; } | ||
|
||
/// <summary> | ||
/// An optional delegate to build health check result. | ||
/// </summary> | ||
public Func<object?, HealthCheckResult>? HealthCheckResultBuilder { get; set; } | ||
} |
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