storage

package
v0.0.0-...-df4534a Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DAOProduct

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

DAOProduct factory of product.Storage

func New

func New(d Driver)

New create the connection with db

func Pool

func Pool() *sql.DB

Pool return a unique instance of db

Types

type Driver

type Driver string

Driver of storage

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

Drivers

type MySQLInvoice

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

MySQLInvoice used for work with MySQL - invoice

func NewMySQLInvoice

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

NewMySQLInvoice return a new pointer of MySQLInvoice

func (*MySQLInvoice) Create

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

Create implement the interface invoice.Storage

type MySQLInvoiceHeader

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

MySQLInvoiceHeader used for work with mySQL - invoiceHeader

func NewMySQLInvoiceHeader

func NewMySQLInvoiceHeader(db *sql.DB) *MySQLInvoiceHeader

NewMySQLInvoiceHeader return a new pointer of MySQLInvoiceHeader

func (*MySQLInvoiceHeader) CreateTx

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

CreateTx implement the interface invoiceHeader.Storage

func (*MySQLInvoiceHeader) Migrate

func (p *MySQLInvoiceHeader) Migrate() error

Migrate implement the interface invoiceHeader.Storage

type MySQLInvoiceItem

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

MySQLInvoiceItem used for work with mySQL - invoiceHeader

func NewMySQLInvoiceItem

func NewMySQLInvoiceItem(db *sql.DB) *MySQLInvoiceItem

NewMySQLInvoiceItem return a new pointer of MySQLInvoiceItem

func (*MySQLInvoiceItem) CreateTx

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

CreateTx implement the interface invoiceitem.Storage

func (*MySQLInvoiceItem) Migrate

func (p *MySQLInvoiceItem) Migrate() error

Migrate implement the interface invoiceItem.Storage

type PsqlInvoice

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

PsqlInvoice used for work with postgres - invoice

func NewPsqlInvoice

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

NewPsqlInvoice return a new pointer of PsqlInvoice

func (*PsqlInvoice) Create

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

Create implement the interface invoice.Storage

type PsqlInvoiceHeader

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

PsqlInvoiceHeader used for work with postgres - invoiceHeader

func NewPsqlInvoiceHeader

func NewPsqlInvoiceHeader(db *sql.DB) *PsqlInvoiceHeader

NewPsqlInvoiceHeader return a new pointer of PsqlInvoiceHeader

func (*PsqlInvoiceHeader) CreateTx

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

CreateTx implement the interface invoiceHeader.Storage

func (*PsqlInvoiceHeader) Migrate

func (p *PsqlInvoiceHeader) Migrate() error

Migrate implement the interface invoiceHeader.Storage

type PsqlInvoiceItem

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

PsqlInvoiceItem used for work with postgres - invoiceHeader

func NewPsqlInvoiceItem

func NewPsqlInvoiceItem(db *sql.DB) *PsqlInvoiceItem

NewPsqlInvoiceItem return a new pointer of PsqlInvoiceItem

func (*PsqlInvoiceItem) CreateTx

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

CreateTx implement the interface invoiceitem.Storage

func (*PsqlInvoiceItem) Migrate

func (p *PsqlInvoiceItem) Migrate() error

Migrate implement the interface invoiceItem.Storage

Jump to

Keyboard shortcuts

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