postgres

package
v0.0.0-...-19dc864 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package postgres implements postgres connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Postgres)

Option -.

func ConnAttempts

func ConnAttempts(attempts int) Option

ConnAttempts -.

func ConnTimeout

func ConnTimeout(timeout time.Duration) Option

ConnTimeout -.

func HealthCheckPeriod

func HealthCheckPeriod(period time.Duration) Option

HealthCheckPeriod -.

func MaxConnIdleTime

func MaxConnIdleTime(idleTime time.Duration) Option

MaxConnIdleTime -.

func MaxConnLifetime

func MaxConnLifetime(lifetime time.Duration) Option

MaxConnLifetime -.

func MaxPoolSize

func MaxPoolSize(size int) Option

MaxPoolSize -.

func MinPoolSize

func MinPoolSize(size int) Option

MinPoolSize -.

type Postgres

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

Postgres -.

func New

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

New -.

func (*Postgres) Close

func (p *Postgres) Close()

Close -.

func (*Postgres) GetPoolStats

func (p *Postgres) GetPoolStats() map[string]interface{}

GetPoolStats returns connection pool statistics for monitoring

func (*Postgres) Ping

func (p *Postgres) Ping(ctx context.Context) error

Ping tests the database connection

Jump to

Keyboard shortcuts

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