postgres

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

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

func Connect

func Connect(ctx context.Context, cfg *pgxpool.Config, now func() time.Time) (*Postgres, error)

Connect parses a database URL into options that can be used to connect to PostgreSQL.

func (*Postgres) Check

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

func (*Postgres) Close

func (p *Postgres) Close()

func (*Postgres) CreateAddress

func (p *Postgres) CreateAddress(ctx context.Context, address *storage.Address) error

func (*Postgres) ExecTx

func (p *Postgres) ExecTx(ctx context.Context, fn func(tx pgx.Tx) error, op errors.Op) error

func (*Postgres) GetAddress

func (p *Postgres) GetAddress(ctx context.Context, cep string) (*storage.Address, error)

func (*Postgres) ListAddresses

func (p *Postgres) ListAddresses(ctx context.Context, params storage.ListParams) ([]*storage.Address, error)

func (*Postgres) UpdateAddress

func (p *Postgres) UpdateAddress(ctx context.Context, cep string, updater storage.Updater) error

Jump to

Keyboard shortcuts

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