sqlstore

package
v0.0.0-...-8851dd1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNullInt

func NewNullInt(v int64) sql.NullInt64

func TestDB

func TestDB(t *testing.T, databaseURL string) (*sql.DB, func(...string))

Types

type ProductRepo

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

func (*ProductRepo) Create

func (r *ProductRepo) Create(p *model.Product, mpiList *model.MarketPlaceItemsList) error

func (*ProductRepo) CreateCategory

func (r *ProductRepo) CreateCategory(c *model.Category) error

func (*ProductRepo) CreateMaterial

func (r *ProductRepo) CreateMaterial(m *model.Material) error

func (*ProductRepo) Delete

func (r *ProductRepo) Delete(productId int, userId int) error

func (*ProductRepo) FindByUserId

func (r *ProductRepo) FindByUserId(userId int) ([]*model.Product, error)

func (*ProductRepo) GetCategories

func (r *ProductRepo) GetCategories() ([]*model.Category, error)

func (*ProductRepo) GetMaterials

func (r *ProductRepo) GetMaterials() ([]*model.Material, error)

func (*ProductRepo) GetProductById

func (r *ProductRepo) GetProductById(productId int) (*model.Product, error)

func (*ProductRepo) Update

func (r *ProductRepo) Update(p *model.Product, mpiList *model.MarketPlaceItemsList) error

type Store

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

Store

func New

func New(db *sql.DB) *Store

Store constructor

func (*Store) Product

func (s *Store) Product() store.ProductRepo

func (*Store) User

func (s *Store) User() store.UserRepo

type UserRepo

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

func (*UserRepo) Create

func (r *UserRepo) Create(u *model.User) error

func (*UserRepo) FindByEmail

func (r *UserRepo) FindByEmail(email string) (*model.User, error)

func (*UserRepo) FindById

func (r *UserRepo) FindById(id int) (*model.User, error)

Jump to

Keyboard shortcuts

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