postgres

package
v0.0.0-...-bdefdd0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPool

func GetPool() *pgxpool.Pool

func New

func New(url string, opts ...Option) error

Types

type Option

type Option func(*Postgres)

func WithConnAttempts

func WithConnAttempts(connAttempts int) Option

WithConnAttempts sets the number of connection attempts.

func WithConnTimeout

func WithConnTimeout(connTimeout time.Duration) Option

WithConnTimeout sets the connection timeout.

func WithMaxPoolSize

func WithMaxPoolSize(maxPoolSize int) Option

WithMaxPoolSize sets the maximum number of connections in the pool.

type Postgres

type Postgres struct {
	Pool *pgxpool.Pool
	// contains filtered or unexported fields
}

func (*Postgres) Close

func (p *Postgres) Close()

Jump to

Keyboard shortcuts

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