pq

package
v0.0.0-...-2bdd4b3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.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        `env:"host"`
	Port            string        `env:"port"`
	Username        string        `env:"username"`
	Password        string        `env:"password"`
	Database        string        `env:"database"`
	SSLMode         string        `env:"ssl_mode"`
	MaxIdleConns    int           `env:"max_idle_conns"`
	MaxOpenConns    int           `env:"max_open_conns"`
	ConnMaxLiftTime time.Duration `env:"conn_max_life_time"`
}

type DB

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

type Postgres

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

func New

func New(config Config) *Postgres

func (*Postgres) Conn

func (p *Postgres) Conn() *sql.DB

func (*Postgres) ConnectTo

func (p *Postgres) ConnectTo() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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