postgres

package
v0.0.0-...-3c68a0f Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: AGPL-3.0 Imports: 7 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        `koanf:"host"`
	Port            int           `koanf:"port"`
	Username        string        `koanf:"username"`
	Password        string        `koanf:"password"`
	DBName          string        `koanf:"db_name"`
	SSLMode         string        `koanf:"ssl_mode"`
	MaxIdleConns    int32         `koanf:"max_idle_conns"`
	MaxOpenConns    int32         `koanf:"max_open_conns"`
	ConnMaxLifetime time.Duration `koanf:"conn_max_lifetime"`
	PathOfMigration string        `koanf:"path_of_migration"`
}

type Database

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

func New

func New(cfg Config, logger *slog.Logger) *Database

func (*Database) Close

func (db *Database) Close()

func (*Database) Conn

func (db *Database) Conn() *pgxpool.Pool

Jump to

Keyboard shortcuts

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