pg

package
v0.0.0-...-0302d1d Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, args Config, options ...Option) (*pgxpool.Pool, error)

func MustConnect

func MustConnect(ctx context.Context, args Config, options ...Option) *pgxpool.Pool

func MustPing

func MustPing(ctx context.Context, conn *pgxpool.Pool, timeout time.Duration)

func Ping

func Ping(ctx context.Context, conn *pgxpool.Pool, timeout time.Duration) error

Types

type Config

type Config struct {
	Host string `env:"HOST"`
	Port string `env:"PORT"`
	Name string `env:"NAME"`
	User string `env:"USER"`
	Pass string `env:"PASS"`
	SSL  string `env:"SSL"`
}

type Option

type Option func(config *pgxpool.Config) *pgxpool.Config

func WithMaxConnections

func WithMaxConnections(maxConnections int32) Option

func WithMinConnections

func WithMinConnections(minConnections int32) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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