dblayer

package
v0.0.0-...-990aa43 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBLayer

type DBLayer interface {
	GetAllProducts() ([]models.Product, error)
	GetPromos() ([]models.Product, error)
	GetCustomerByName(string, string) (models.Customer, error)
	GetCustomerByID(int) (models.Customer, error)
	GetProduct(uint) (models.Product, error)
	AddUser(models.Customer) error
	SignInUser(models.Customer) error
	SignOutUserById(int) error
	GetCustomerOrdersByID(int) ([]models.Order, error)
}

type DBORM

type DBORM struct {
	*gorm.DB
}

func NewORM

func NewORM(dbname, con string) (*DBORM, error)

func (*DBORM) AddUser

func (db *DBORM) AddUser(models.Customer) error

func (*DBORM) GetAllProducts

func (db *DBORM) GetAllProducts() ([]models.Product, error)

func (*DBORM) GetCustomerByID

func (db *DBORM) GetCustomerByID(int) (models.Customer, error)

func (*DBORM) GetCustomerByName

func (db *DBORM) GetCustomerByName(string, string) (models.Customer, error)

func (*DBORM) GetCustomerOrdersByID

func (db *DBORM) GetCustomerOrdersByID(int) ([]models.Order, error)

func (*DBORM) GetProduct

func (db *DBORM) GetProduct(uint) (models.Product, error)

func (*DBORM) GetPromos

func (db *DBORM) GetPromos() ([]models.Product, error)

func (*DBORM) SignInUser

func (db *DBORM) SignInUser(models.Customer) error

func (*DBORM) SignOutUserById

func (db *DBORM) SignOutUserById(int) error

Jump to

Keyboard shortcuts

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