storage

package
v0.0.0-...-8ebb9f7 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DAOProduct

func DAOProduct(d Driver) (product.Storage, error)

DAOProduct factory of product.Storage

func New

func New(d Driver)

New creates connection with DB

func Pool

func Pool() *sql.DB

Pool returns a unique instance of db

Types

type Driver

type Driver string

Driver of sotrage

const (
	MySQL    Driver = "MYSQL"
	Postgres Driver = "POSTGRES"
)

Drivers

type MySQLInvoice

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

MySQLInvoice used to work with MySQL - invoice

func NewMySQLInvoice

func NewMySQLInvoice(db *sql.DB, h invoiceheader.Storage, i invoiceitem.Storage) *MySQLInvoice

NewMySQLInvoice returns new pointer to MySQLInvoice

func (*MySQLInvoice) Create

func (p *MySQLInvoice) Create(m *invoice.Model) error

Create implements interface invoice.Storage

type MySQLInvoiceHeader

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

MySQLInvoiceHeader used to work with MySQL - invoiceheader

func NewMySQLInvoiceHeader

func NewMySQLInvoiceHeader(db *sql.DB) *MySQLInvoiceHeader

NewMySQLInvoiceHeader returns new pointer to MySQLInvoiceHeader

func (*MySQLInvoiceHeader) CreateTx

func (p *MySQLInvoiceHeader) CreateTx(tx *sql.Tx, m *invoiceheader.Model) error

CreateTx implements interface invoiceheader.Storage

func (*MySQLInvoiceHeader) Migrate

func (p *MySQLInvoiceHeader) Migrate() error

Migrate implements interface invoiceheader.Storage

type MySQLInvoiceItem

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

MySQLInvoiceItem used to work with MySQL - invoiceitem

func NewMySQLInvoiceItem

func NewMySQLInvoiceItem(db *sql.DB) *MySQLInvoiceItem

NewMySQLInvoiceItem returns new pointer to MySQLInvoiceItem

func (*MySQLInvoiceItem) CreateTx

func (p *MySQLInvoiceItem) CreateTx(tx *sql.Tx, headerID uint, ms invoiceitem.Models) error

CreateTx implements interface invoiceitem.Storage

func (*MySQLInvoiceItem) Migrate

func (p *MySQLInvoiceItem) Migrate() error

Migrate implements interface invoiceitem.Storage

type PsqlInvoice

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

PsqlInvoice used to work with postgres - invoice

func NewPsqlInvoice

func NewPsqlInvoice(db *sql.DB, h invoiceheader.Storage, i invoiceitem.Storage) *PsqlInvoice

NewPsqlInvoice returns new pointer to PsqlInvoice

func (*PsqlInvoice) Create

func (p *PsqlInvoice) Create(m *invoice.Model) error

Create implements interface invoice.Storage

type PsqlInvoiceHeader

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

PsqlInvoiceHeader used to work with postgres - invoiceheader

func NewPsqlInvoiceHeader

func NewPsqlInvoiceHeader(db *sql.DB) *PsqlInvoiceHeader

NewPsqlInvoiceHeader returns new pointer to PsqlInvoiceHeader

func (*PsqlInvoiceHeader) CreateTx

func (p *PsqlInvoiceHeader) CreateTx(tx *sql.Tx, m *invoiceheader.Model) error

CreateTx implements interface invoiceheader.Storage

func (*PsqlInvoiceHeader) Migrate

func (p *PsqlInvoiceHeader) Migrate() error

Migrate implements interface invoiceheader.Storage

type PsqlInvoiceItem

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

PsqlInvoiceItem used to work with postgres - invoiceitem

func NewPsqlInvoiceItem

func NewPsqlInvoiceItem(db *sql.DB) *PsqlInvoiceItem

NewPsqlInvoiceItem returns new pointer to PsqlInvoiceItem

func (*PsqlInvoiceItem) CreateTx

func (p *PsqlInvoiceItem) CreateTx(tx *sql.Tx, headerID uint, ms invoiceitem.Models) error

CreateTx implements interface invoiceitem.Storage

func (*PsqlInvoiceItem) Migrate

func (p *PsqlInvoiceItem) Migrate() error

Migrate implements interface invoiceitem.Storage

Jump to

Keyboard shortcuts

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