Documentation
¶
Index ¶
- func NewDatabasePool(ctx context.Context, cfg *config.DatabaseConfig) (*pgxpool.Pool, error)
- type AddressService
- func (s *AddressService) Create(ctx context.Context, params anor.AddressCreateParams) (anor.Address, error)
- func (s *AddressService) Get(ctx context.Context, id int64) (anor.Address, error)
- func (s *AddressService) GetDefault(ctx context.Context, userID int64, defaultFor anor.AddressDefaultType) (anor.Address, error)
- func (s *AddressService) List(ctx context.Context, params anor.AddressListParams) ([]anor.Address, error)
- type CartService
- func (s *CartService) AddItem(ctx context.Context, params anor.CartItemAddParams) (anor.CartItem, error)
- func (s *CartService) CountItems(ctx context.Context, cartID int64) (int64, error)
- func (s *CartService) Create(ctx context.Context, params anor.CartCreateParams) (anor.Cart, error)
- func (s *CartService) DeleteItem(ctx context.Context, itemID int64) error
- func (s *CartService) Get(ctx context.Context, id int64, includeItems bool) (anor.Cart, error)
- func (s *CartService) GetByUserID(ctx context.Context, userID int64, includeItems bool) (anor.Cart, error)
- func (s *CartService) IsMyItem(ctx context.Context, params anor.IsMyCartItemParams) (bool, error)
- func (s *CartService) ListItems(ctx context.Context, params anor.CartItemListParams) ([]anor.CartItem, error)
- func (s *CartService) Merge(ctx context.Context, params anor.CartMergeParams) (anor.Cart, error)
- func (s *CartService) Update(ctx context.Context, id int64, params anor.CartUpdateParams) error
- func (s *CartService) UpdateItem(ctx context.Context, itemID int64, params anor.CartItemUpdateParams) error
- type CategoryService
- func (s *CategoryService) GetAncestorCategories(ctx context.Context, categoryID int32) ([]anor.Category, error)
- func (s *CategoryService) GetCategory(ctx context.Context, categoryID int32) (anor.Category, error)
- func (s *CategoryService) GetCategoryHierarchy(ctx context.Context, c anor.Category) (anor.CategoryHierarchy, error)
- func (s *CategoryService) GetCategoryWithAncestors(ctx context.Context, categoryID int32) (anor.CategoryWithAncestors, error)
- func (s *CategoryService) GetChildCategories(ctx context.Context, categoryID int32) ([]anor.Category, error)
- func (s *CategoryService) GetRootCategories(ctx context.Context) ([]anor.Category, error)
- func (s *CategoryService) GetSiblingCategories(ctx context.Context, categoryID int32) ([]anor.Category, error)
- type FeaturedSelectionService
- type OrderService
- func (s *OrderService) Create(ctx context.Context, params anor.OrderCreateParams) (int64, error)
- func (s *OrderService) Get(ctx context.Context, orderID int64, withItems bool) (anor.Order, error)
- func (s *OrderService) List(ctx context.Context, params anor.OrderListParams) ([]anor.Order, error)
- func (s *OrderService) ListActive(ctx context.Context, params anor.OrderListParams) ([]anor.Order, error)
- func (s *OrderService) ListUnpaid(ctx context.Context, params anor.OrderListParams) ([]anor.Order, error)
- type ProductService
- func (s *ProductService) Get(ctx context.Context, id int64, with relation.Set) (*anor.Product, error)
- func (s *ProductService) GetMinMaxPricesByCategory(ctx context.Context, category anor.Category) ([2]decimal.Decimal, error)
- func (s *ProductService) ListAllBrandsByCategory(ctx context.Context, category anor.Category) ([]string, error)
- func (s *ProductService) ListByCategory(ctx context.Context, category anor.Category, params anor.ListByCategoryParams) ([]anor.Product, int64, error)
- func (s *ProductService) ListPopularProducts(ctx context.Context, params anor.PopularProductListParams) ([]anor.Product, error)
- type StripePaymentService
- type UserService
- func (s UserService) Create(ctx context.Context, params anor.UserCreateParams) (anor.User, error)
- func (s UserService) Get(ctx context.Context, id int64) (anor.User, error)
- func (s UserService) GetActivityCounts(ctx context.Context, id int64) (anor.UserActivityCounts, error)
- func (s UserService) GetByEmail(ctx context.Context, email string) (anor.User, error)
- func (s UserService) UpdatePassword(ctx context.Context, id int64, password string) error
- func (s UserService) UpdateStatusByEmail(ctx context.Context, status anor.UserStatus, email string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatabasePool ¶
Types ¶
type AddressService ¶
type AddressService struct {
// contains filtered or unexported fields
}
func NewAddressService ¶
func NewAddressService(ar address.Repository) *AddressService
func (*AddressService) Create ¶
func (s *AddressService) Create(ctx context.Context, params anor.AddressCreateParams) (anor.Address, error)
func (*AddressService) GetDefault ¶
func (s *AddressService) GetDefault(ctx context.Context, userID int64, defaultFor anor.AddressDefaultType) (anor.Address, error)
func (*AddressService) List ¶
func (s *AddressService) List(ctx context.Context, params anor.AddressListParams) ([]anor.Address, error)
type CartService ¶
type CartService struct {
// contains filtered or unexported fields
}
func NewCartService ¶
func NewCartService(cr cart.Repository, pr product.Repository) *CartService
func (*CartService) AddItem ¶
func (s *CartService) AddItem(ctx context.Context, params anor.CartItemAddParams) (anor.CartItem, error)
func (*CartService) CountItems ¶
func (*CartService) Create ¶
func (s *CartService) Create(ctx context.Context, params anor.CartCreateParams) (anor.Cart, error)
func (*CartService) DeleteItem ¶
func (s *CartService) DeleteItem(ctx context.Context, itemID int64) error
func (*CartService) GetByUserID ¶
func (*CartService) IsMyItem ¶
func (s *CartService) IsMyItem(ctx context.Context, params anor.IsMyCartItemParams) (bool, error)
func (*CartService) ListItems ¶
func (s *CartService) ListItems(ctx context.Context, params anor.CartItemListParams) ([]anor.CartItem, error)
func (*CartService) Merge ¶
func (s *CartService) Merge(ctx context.Context, params anor.CartMergeParams) (anor.Cart, error)
func (*CartService) Update ¶
func (s *CartService) Update(ctx context.Context, id int64, params anor.CartUpdateParams) error
func (*CartService) UpdateItem ¶
func (s *CartService) UpdateItem(ctx context.Context, itemID int64, params anor.CartItemUpdateParams) error
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func NewCategoryService ¶
func NewCategoryService(cr category.Repository, cache cache.CategoryCache) *CategoryService
func (*CategoryService) GetAncestorCategories ¶
func (*CategoryService) GetCategory ¶
func (*CategoryService) GetCategoryHierarchy ¶
func (s *CategoryService) GetCategoryHierarchy(ctx context.Context, c anor.Category) (anor.CategoryHierarchy, error)
func (*CategoryService) GetCategoryWithAncestors ¶
func (s *CategoryService) GetCategoryWithAncestors(ctx context.Context, categoryID int32) (anor.CategoryWithAncestors, error)
func (*CategoryService) GetChildCategories ¶
func (*CategoryService) GetRootCategories ¶
func (*CategoryService) GetSiblingCategories ¶
type FeaturedSelectionService ¶
type FeaturedSelectionService struct {
// contains filtered or unexported fields
}
func NewFeaturedSelectionService ¶
func NewFeaturedSelectionService(fsr featured_selection.Repository, pr product.Repository, cr category.Repository) *FeaturedSelectionService
func (*FeaturedSelectionService) ListAllActive ¶
func (s *FeaturedSelectionService) ListAllActive(ctx context.Context) ([]anor.FeaturedSelection, error)
type OrderService ¶
type OrderService struct {
// contains filtered or unexported fields
}
func NewOrderService ¶
func NewOrderService(or order.Repository) *OrderService
func (*OrderService) Create ¶
func (s *OrderService) Create(ctx context.Context, params anor.OrderCreateParams) (int64, error)
func (*OrderService) List ¶
func (s *OrderService) List(ctx context.Context, params anor.OrderListParams) ([]anor.Order, error)
func (*OrderService) ListActive ¶
func (s *OrderService) ListActive(ctx context.Context, params anor.OrderListParams) ([]anor.Order, error)
func (*OrderService) ListUnpaid ¶
func (s *OrderService) ListUnpaid(ctx context.Context, params anor.OrderListParams) ([]anor.Order, error)
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
func NewProductService ¶
func NewProductService(ps product.Repository, cs category.Repository) *ProductService
func (*ProductService) GetMinMaxPricesByCategory ¶
func (*ProductService) ListAllBrandsByCategory ¶
func (*ProductService) ListByCategory ¶
func (*ProductService) ListPopularProducts ¶
func (s *ProductService) ListPopularProducts(ctx context.Context, params anor.PopularProductListParams) ([]anor.Product, error)
type StripePaymentService ¶
type StripePaymentService struct {
// contains filtered or unexported fields
}
func NewStipePaymentService ¶
func NewStipePaymentService(pr payment.Repository) *StripePaymentService
func (*StripePaymentService) Create ¶
func (s *StripePaymentService) Create(ctx context.Context, params anor.StripePaymentCreateParams) error
func (*StripePaymentService) GetByOrderID ¶
func (s *StripePaymentService) GetByOrderID(ctx context.Context, orderID int64) (anor.StripeCardPayment, error)
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(us user.Repository, cs cart.Repository, os order.Repository) *UserService
func (UserService) Create ¶
func (s UserService) Create(ctx context.Context, params anor.UserCreateParams) (anor.User, error)
func (UserService) GetActivityCounts ¶
func (s UserService) GetActivityCounts(ctx context.Context, id int64) (anor.UserActivityCounts, error)
func (UserService) GetByEmail ¶
func (UserService) UpdatePassword ¶
func (UserService) UpdateStatusByEmail ¶
func (s UserService) UpdateStatusByEmail(ctx context.Context, status anor.UserStatus, email string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.