db

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPingTimeout = 3 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker implements health.Checker.

func NewChecker

func NewChecker(name string, pinger CtxPinger, opts ...Option) *Checker

NewChecker returns a Checker using the provided name and CtxPinger.

func (*Checker) Check

func (c *Checker) Check(ctx context.Context) *healthpb.Check

type CtxPinger

type CtxPinger interface {
	PingContext(context.Context) error
}

CtxPinger defines the interface for the database functionality used to perform the health check.

type Option

type Option func(*Checker)

Option is a functional decorator for creating a new Checker.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the timeout on the PingContext check.

Jump to

Keyboard shortcuts

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