sqlhealth

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package sqlhealth provides a health check for a SQL database connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker checks the health of a SQL database.

func New

func New(db *sql.DB) *Checker

New starts a new asynchronous ping of the SQL database. Pings will be sent until one succeeds or Stop is called, whichever comes first.

func (*Checker) CheckHealth

func (c *Checker) CheckHealth() error

CheckHealth returns nil iff the ping started by New has returned success.

func (*Checker) Stop

func (c *Checker) Stop()

Stop stops any ongoing ping of the database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL