database

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnString added in v0.1.2

func ConnString(cfg Config) string

ConnString translates config to a db connection string.

func Connect added in v0.1.2

func Connect(ctx context.Context, cfg Config) (*pgxpool.Pool, error)

Connect establishes a database connection based on the configuration.

func StatusCheck

func StatusCheck(ctx context.Context, db *pgxpool.Pool) error

StatusCheck returns nil if it can successfully talk to the database. It returns a non-nil error otherwise.

Types

type Config

type Config struct {
	User       string
	Password   string
	Host       string
	Name       string
	DisableTLS bool
}

Config is the required properties to use the database.

Jump to

Keyboard shortcuts

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