repository

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

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

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductRepository

type ProductRepository interface {
	Create(ctx context.Context, product model.Product) error
	Read(context.Context) ([]model.Product, error)
	Update(ctx context.Context, product model.Product) error
	Delete(ctx context.Context, productID int64) error
	ReadByID(ctx context.Context, id int64) (*model.Product, error)
	UpdateStock(ctx context.Context, productID int64, newStock int64) error
}

func NewProductRepository

func NewProductRepository(db *sql.DB) ProductRepository

type TransactionRepository

type TransactionRepository interface {
	Create(context.Context, model.Transaction) (*model.Transaction, error)
	Update(context.Context, model.Transaction) error
	UpdateStatus(ctx context.Context, transactionID int64, status string) error
	ReadByID(ctx context.Context, transactionID int64) (*model.Transaction, error)
}

func NewTransactionRepository

func NewTransactionRepository(db *sql.DB) TransactionRepository

type UserRepository

type UserRepository interface {
	Create(context.Context, model.User) error
	Read(context.Context) ([]model.User, error)
	Update(ctx context.Context, request model.User) error
	Delete(ctx context.Context, userid int64) error
	ReadByID(ctx context.Context, userid int64) (user model.User, err error)
	ReadByUsername(ctx context.Context, username string) (user model.User, err error)
	CountUser(ctx context.Context, request model.User) (int32, error)
}

func NewUserRepository

func NewUserRepository(db *sql.DB) UserRepository

Jump to

Keyboard shortcuts

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