postgres

package
v0.0.0-...-3bb7120 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabasePool

func NewDatabasePool(ctx context.Context, cfg *config.DatabaseConfig) (*pgxpool.Pool, error)

Types

type AddressService

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

func NewAddressService

func NewAddressService(ar address.Repository) *AddressService

func (*AddressService) Create

func (*AddressService) Get

func (s *AddressService) Get(ctx context.Context, id int64) (anor.Address, error)

func (*AddressService) GetDefault

func (s *AddressService) GetDefault(ctx context.Context, userID int64, defaultFor anor.AddressDefaultType) (anor.Address, error)

func (*AddressService) List

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 (s *CartService) CountItems(ctx context.Context, cartID int64) (int64, error)

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) Get

func (s *CartService) Get(ctx context.Context, id int64, includeItems bool) (anor.Cart, error)

func (*CartService) GetByUserID

func (s *CartService) GetByUserID(ctx context.Context, userID int64, includeItems bool) (anor.Cart, error)

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 (s *CategoryService) GetAncestorCategories(ctx context.Context, categoryID int32) ([]anor.Category, error)

func (*CategoryService) GetCategory

func (s *CategoryService) GetCategory(ctx context.Context, categoryID int32) (anor.Category, error)

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 (s *CategoryService) GetChildCategories(ctx context.Context, categoryID int32) ([]anor.Category, error)

func (*CategoryService) GetRootCategories

func (s *CategoryService) GetRootCategories(ctx context.Context) ([]anor.Category, error)

func (*CategoryService) GetSiblingCategories

func (s *CategoryService) GetSiblingCategories(ctx context.Context, categoryID int32) ([]anor.Category, error)

type FeaturedSelectionService

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

func (*FeaturedSelectionService) ListAllActive

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) Get

func (s *OrderService) Get(ctx context.Context, orderID int64, withItems bool) (anor.Order, 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 (*ProductService) Get

func (s *ProductService) Get(ctx context.Context, id int64, with relation.Set) (*anor.Product, error)

func (*ProductService) GetMinMaxPricesByCategory

func (s *ProductService) GetMinMaxPricesByCategory(ctx context.Context, category anor.Category) ([2]decimal.Decimal, error)

func (*ProductService) ListAllBrandsByCategory

func (s *ProductService) ListAllBrandsByCategory(ctx context.Context, category anor.Category) ([]string, error)

func (*ProductService) ListByCategory

func (s *ProductService) ListByCategory(ctx context.Context, category anor.Category, params anor.ListByCategoryParams) ([]anor.Product, int64, error)

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 (*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) Get

func (s UserService) Get(ctx context.Context, id int64) (anor.User, error)

func (UserService) GetActivityCounts

func (s UserService) GetActivityCounts(ctx context.Context, id int64) (anor.UserActivityCounts, error)

func (UserService) GetByEmail

func (s UserService) GetByEmail(ctx context.Context, email string) (anor.User, error)

func (UserService) UpdatePassword

func (s UserService) UpdatePassword(ctx context.Context, id int64, password string) error

func (UserService) UpdateStatusByEmail

func (s UserService) UpdateStatusByEmail(ctx context.Context, status anor.UserStatus, email string) error

Directories

Path Synopsis
repository

Jump to

Keyboard shortcuts

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