pq

package
v0.0.0-...-b3f0c1d Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 5 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"`
	Username        string        `mapstructure:"username"`
	Password        string        `mapstructure:"password"`
	Database        string        `mapstructure:"database"`
	SSLMode         string        `mapstructure:"ssl_mode"`
	MaxIdleConns    int           `mapstructure:"max_idle_conns"`
	MaxOpenConns    int           `mapstructure:"max_open_conns"`
	ConnMaxLiftTime time.Duration `mapstructure:"conn_max_life_time"`
}

type DB

type DB interface {
	Conn() *sql.DB
}

type PostgresDB

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

func New

func New(config Config) *PostgresDB

func (*PostgresDB) Conn

func (m *PostgresDB) Conn() *sql.DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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