gocloud.dev: gocloud.dev/server/health/sqlhealth Index | Files

package sqlhealth

import "gocloud.dev/server/health/sqlhealth"

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


Package Files


type Checker Uses

type Checker struct {
    // contains filtered or unexported fields

Checker checks the health of a SQL database.

func New Uses

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 Uses

func (c *Checker) CheckHealth() error

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

func (*Checker) Stop Uses

func (c *Checker) Stop()

Stop stops any ongoing ping of the database.

Package sqlhealth imports 4 packages (graph) and is imported by 4 packages. Updated 2019-07-09. Refresh now. Tools for package owners.