postgres

package
v0.0.0-...-0e0a2a2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresRepository

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

func NewPostgresRepository

func NewPostgresRepository(ctx context.Context, db *sqlx.DB) *PostgresRepository

func (*PostgresRepository) CreateGood

func (r *PostgresRepository) CreateGood(ctx context.Context, param barter.Good) (*barter.Good, common.Error)

func (*PostgresRepository) CreateTrader

func (r *PostgresRepository) CreateTrader(ctx context.Context, param barter.Trader) (*barter.Trader, common.Error)

func (*PostgresRepository) DeleteGoodByID

func (r *PostgresRepository) DeleteGoodByID(ctx context.Context, id int) common.Error

func (*PostgresRepository) GetGoodByID

func (r *PostgresRepository) GetGoodByID(ctx context.Context, id int) (*barter.Good, common.Error)

func (*PostgresRepository) GetTraderByEmail

func (r *PostgresRepository) GetTraderByEmail(ctx context.Context, email string) (*barter.Trader, common.Error)

func (*PostgresRepository) ListGoods

func (r *PostgresRepository) ListGoods(ctx context.Context) ([]barter.Good, common.Error)

func (*PostgresRepository) ListGoodsByOwner

func (r *PostgresRepository) ListGoodsByOwner(ctx context.Context, ownerID int) ([]barter.Good, common.Error)

func (*PostgresRepository) UpdateGood

func (r *PostgresRepository) UpdateGood(ctx context.Context, good barter.Good) (updatedGood *barter.Good, err common.Error)

func (*PostgresRepository) UpdateGoods

func (r *PostgresRepository) UpdateGoods(ctx context.Context, goods []barter.Good) (updatedGoods []barter.Good, err common.Error)

Jump to

Keyboard shortcuts

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