dbping

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 5 * time.Second

DefaultTimeout is the allowed time budger for a single ping where 5 seconds is long enough for a cold connection over a slow link.

Variables

This section is empty.

Functions

func Postgres

func Postgres(url string, timeout time.Duration) error

Postgres opens a connection to url and runs a single `ping` to check availability. Returns nil if the database is reachable and accepts queries. A timeout of zero falls back to DefaultTimeout.

func Redis

func Redis(url string, timeout time.Duration) error

Redis parses url (redis:// | rediss://) and runs a PING. Returns nil if instance is reachable or an error otherwise. Zero timeout falls back to DefaultTimeout. Used for validating connectivity before scaffolding.

Types

This section is empty.

Jump to

Keyboard shortcuts

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