Skip to content

Commit

Permalink
fix: add public init
Browse files Browse the repository at this point in the history
  • Loading branch information
gulivero1773 committed Mar 29, 2024
1 parent ac0c932 commit 85838ef
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public struct ApplicationHealthChecks: ApplicationHealthChecksProtocol {
/// Reference to the application instance.
public let app: Application

/// Initializer for ApplicationHealthChecks
/// - Parameter app: `Application`
public init(app: Application) {
self.app = app
}

/// Get uptime of the system.
/// - Returns: A `HealthCheckItem` representing the application's uptime.
public func uptime() -> HealthCheckItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public struct ConsulHealthChecks: ConsulHealthChecksProtocol {
/// The instance of the Vapor application as `Application`.
public let app: Application

/// Initializer for ConsulHealthChecks
/// - Parameter app: `Application`
public init(app: Application) {
self.app = app
}

/// Performs health checks for specified measurement types.
///
/// - Parameters:
Expand Down
11 changes: 10 additions & 1 deletion Sources/HealthChecks/MongoHealthChecks/MongoHealthChecks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ public struct MongoHealthChecks: MongoHealthChecksProtocol {

/// Instance of url as `String` for mongo
public let url: String


/// Initializer for MongoHealthChecks
/// - Parameters:
/// - app: `Application`
/// - url: `String`
public init(app: Application, url: String) {
self.app = app
self.url = url
}

/// Get mongo connection
/// - Returns: `HealthCheckItem`
public func connection() async -> HealthCheckItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ import FluentPostgresDriver
public struct PostgresHealthChecks: PostgresHealthChecksProtocol {
/// Instance of app as `Application`
public let app: Application

/// Initializer for PostgresHealthChecks
/// - Parameter app: `Application`
public init(app: Application) {
self.app = app
}

/// Get psql version
/// - Returns: `HealthCheckItem`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import Redis
public struct RedisHealthChecks: RedisHealthChecksProtocol {
/// Instance of app as `Application`
public let app: Application

/// Initializer for RedisHealthChecks
/// - Parameter app: `Application`
public init(app: Application) {
self.app = app
}

/// Get redis connection
/// - Returns: `HealthCheckItem`
Expand Down

0 comments on commit 85838ef

Please sign in to comment.