database

package
v0.0.0-...-70a5fc5 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string `mapstructure:"host"`
	Port     string `mapstructure:"port"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
	DBName   string `mapstructure:"dbname"`
	SSLMode  string `mapstructure:"sslmode"`
	MaxConns int32  `mapstructure:"max_conns"`
}

type Database

type Database struct {
	Pool *pgxpool.Pool
}

func New

func New(ctx context.Context, cfg *Config) (*Database, error)

func (*Database) Close

func (db *Database) Close()

func (*Database) HealthCheck

func (db *Database) HealthCheck(ctx context.Context) error

HealthCheck returns true if the database is reachable

Jump to

Keyboard shortcuts

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