postgres

package
v0.0.0-...-4def8c9 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() *pgxpool.Pool

Types

type CustomerStorage

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

CustomerStorage type that implements customer.Storage interface for postgresql

func NewCustomerStorage

func NewCustomerStorage(db *pgxpool.Pool) CustomerStorage

NewCustomerStorage creates a new customer storage with db dependency

func (CustomerStorage) Customer

func (s CustomerStorage) Customer(ctx context.Context, document string) (customer.Customer, error)

Customer returns customer by document from postgresql

func (CustomerStorage) SaveCustomer

func (s CustomerStorage) SaveCustomer(tcx db.TxContext, customer customer.Customer) error

SaveCustomer persists entity customer in postgresql

type OrderStorage

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

OrderStorage type that implements OrderStorage interface for postgresql

func NewOrderStorage

func NewOrderStorage(db *pgxpool.Pool) OrderStorage

NewOrderStorage creates a new order storage with db dependency

func (OrderStorage) DeleteOrder

func (s OrderStorage) DeleteOrder(tcx db.TxContext, id string) error

DeleteOrder removes entity order from postgresql

func (OrderStorage) Order

func (s OrderStorage) Order(ctx context.Context, id string) (order.Order, error)

Order returns order by id from postgresql

func (OrderStorage) SaveOrder

func (s OrderStorage) SaveOrder(tcx db.TxContext, o order.Order) error

SaveOrder persists entity order in postgresql

Jump to

Keyboard shortcuts

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