pingstore

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package pingstore enables database health checks through the db PingContext method. The Pinger interface allows mocking the Ping when testing with no db connectivity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastorer added in v0.34.0

type Datastorer interface {
	// DB returns a sql.DB
	DB() *sql.DB
}

Datastorer is an interface for working with the Database

type Pinger

type Pinger struct {
	Datastorer
}

Pinger is the default implementation for pinging the db

func NewPinger added in v0.34.0

func NewPinger(ds Datastorer) Pinger

NewPinger is an initializer for DefaultPinger

func (Pinger) PingDB

func (d Pinger) PingDB(ctx context.Context) error

PingDB pings the DB

Jump to

Keyboard shortcuts

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