Documentation ¶
Index ¶
- func NewCartRepository(db *DB) *cartRepo
- func NewPaymentRepository(db *DB) *paymentRepo
- func NewProductRepository(db *DB) *productRepo
- func NewRepository(db *DB) *repository
- func NewUserRepository(db *DB) *userRepo
- type CartRepository
- type DB
- type PaymentRepository
- type ProductRepository
- type Repository
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCartRepository ¶
func NewCartRepository(db *DB) *cartRepo
func NewPaymentRepository ¶
func NewPaymentRepository(db *DB) *paymentRepo
func NewProductRepository ¶
func NewProductRepository(db *DB) *productRepo
func NewRepository ¶
func NewRepository(db *DB) *repository
func NewUserRepository ¶
func NewUserRepository(db *DB) *userRepo
Types ¶
type CartRepository ¶
type CartRepository interface { CreateItem(ctx context.Context, data *model.CartItem) (*model.CartItem, error) UpdateItem(ctx context.Context, data *model.CartItem) (*model.CartItem, error) DeleteItem(ctx context.Context, cartID int64, prodID int64) error GetItem(ctx context.Context, cartID int64, prodID int64) (*model.CartItem, error) GetItems(ctx context.Context, cartID int64) ([]model.CartItem, error) Create(ctx context.Context, username string, code string) (*model.Cart, error) Update(ctx context.Context, data *model.Cart) (*model.Cart, error) Delete(ctx context.Context, id int64) error GetByID(ctx context.Context, id int64) (*model.Cart, error) GetByCode(ctx context.Context, code string) (*model.Cart, error) GetActiveCart(ctx context.Context) (*model.Cart, error) }
type PaymentRepository ¶
type ProductRepository ¶
type ProductRepository interface { Create(ctx context.Context, data *model.Product) (*model.Product, error) Update(ctx context.Context, id int64, data *model.Product) (*model.Product, error) DeleteByID(ctx context.Context, id int64) error GetByID(ctx context.Context, id int64) (*model.Product, error) GetByCode(ctx context.Context, code string) (*model.Product, error) GetBySlug(ctx context.Context, slug string) (*model.Product, error) GetAll(ctx context.Context) ([]model.Product, error) }
type Repository ¶
type Repository interface { Product() ProductRepository Cart() CartRepository Payment() PaymentRepository User() UserRepository }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.