Documentation ¶
Index ¶
- type ProductService
- func (ps *ProductService) FakeBundle(marketplaceCode string, isNew bool, isExclusive bool, isOutOfStock bool, ...) domain.BundleProduct
- func (ps *ProductService) FakeSimple(marketplaceCode string, isNew bool, isExclusive bool, isOutOfStock bool, ...) domain.SimpleProduct
- func (ps *ProductService) Get(_ context.Context, marketplaceCode string) (domain.BasicProduct, error)
- func (ps *ProductService) GetMarketPlaceCodes() []string
- func (ps *ProductService) Inject(logger flamingo.Logger, c ...) *ProductService
- type SearchService
- func (s *SearchService) Inject(productService *ProductService, cfg ...) *SearchService
- func (s *SearchService) Search(ctx context.Context, filters ...searchDomain.Filter) (*domain.SearchResult, error)
- func (s *SearchService) SearchBy(ctx context.Context, attribute string, _ []string, ...) (*domain.SearchResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
ProductService is just mocking stuff
func (*ProductService) FakeBundle ¶ added in v3.6.0
func (ps *ProductService) FakeBundle(marketplaceCode string, isNew bool, isExclusive bool, isOutOfStock bool, isDiscounted bool, hasFixedPrice bool) domain.BundleProduct
FakeBundle generates a bundle fake product
func (*ProductService) FakeSimple ¶
func (ps *ProductService) FakeSimple(marketplaceCode string, isNew bool, isExclusive bool, isOutOfStock bool, isDiscounted bool, hasFixedPrice bool) domain.SimpleProduct
FakeSimple generates a simple fake product
func (*ProductService) Get ¶
func (ps *ProductService) Get(_ context.Context, marketplaceCode string) (domain.BasicProduct, error)
Get returns a product struct
func (*ProductService) GetMarketPlaceCodes ¶ added in v3.4.0
func (ps *ProductService) GetMarketPlaceCodes() []string
GetMarketPlaceCodes returns list of available marketplace codes which are supported by this fakeservice
func (*ProductService) Inject ¶
func (ps *ProductService) Inject(logger flamingo.Logger, c *struct { CurrencyCode string `inject:"config:commerce.product.fakeservice.currency,optional"` TestDataFolder string `inject:"config:commerce.product.fakeservice.jsonTestDataFolder,optional"` DeliveryDefaultProducts bool `inject:"config:commerce.product.fakeservice.defaultProducts,optional"` DeliveryCodes []string `inject:"config:commerce.product.fakeservice.deliveryCodes,optional"` }, ) *ProductService
Inject dependencies
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
SearchService is just mocking stuff
func (*SearchService) Inject ¶
func (s *SearchService) Inject( productService *ProductService, cfg *struct { LiveSearchJSON string `inject:"config:commerce.product.fakeservice.jsonTestDataLiveSearch,optional"` CategoryFacetItemsJSON string `inject:"config:commerce.product.fakeservice.jsonTestDataCategoryFacetItems,optional"` }, ) *SearchService
Inject dependencies
func (*SearchService) Search ¶
func (s *SearchService) Search(ctx context.Context, filters ...searchDomain.Filter) (*domain.SearchResult, error)
Search returns Products based on given Filters
func (*SearchService) SearchBy ¶
func (s *SearchService) SearchBy(ctx context.Context, attribute string, _ []string, filters ...searchDomain.Filter) (*domain.SearchResult, error)
SearchBy returns Products prefiltered by the given attribute (also based on additional given Filters)
Click to show internal directories.
Click to hide internal directories.