Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImagePaths ¶ added in v1.1.0
type ImagePaths struct {
Original, Size70, Size110, Size180, Size220 string
}
ImagePaths contains a product images in various sizes
type IncredibleOffer ¶
type IncredibleOffer struct {
ID uint
ProductID uint
Title string
ImagePaths ImagePaths
BannerPath string
BannerPathMobile string
BannerPathTablet string
Row uint
ProductTitleFa string
ProductTitleEn string
Discount uint
Price uint
OnlyForApplication bool
OnlyForMembers bool
}
IncredibleOffer is a struct containing DGKala incredible offer properties
func IncredibleOffers ¶
func IncredibleOffers() ([]IncredibleOffer, error)
IncredibleOffers get a slice of DGKala IncredibleOffer items
type ProductByID ¶ added in v1.1.0
type ProductByID struct {
ID uint `json:"ProductId"`
EnglishTitle string `json:"EnTitle"`
PersianTitle string `json:"FaTitle"`
Description string
ImagePaths ImagePaths
IsIncredibleOffer bool
Strengths string
Weaknesses string
MinPrice uint
}
ProductByID is a struct containing a product details when you get it by ID
func GetProductByID ¶ added in v1.1.0
func GetProductByID(productID int) (ProductByID, error)
GetProductByID returns a product by getting it's ID
type ProductByIDResult ¶ added in v1.1.0
type ProductByIDResult struct {
Data ProductByID
}
ProductByIDResult returns a struct containing results of the request for product details by ID
type ProductColor ¶
ProductColor is a struct with properties of products colors
type ProductExistsStatus ¶
type ProductExistsStatus int
ProductExistsStatus is a iota type for product existing status for buying
const ( // Available means the product is available to buy Available ProductExistsStatus // OutOfStock means the product is not available now and is out of stock OutOfStock // Discontinued means the product is discontinued Discontinued )
type ProductSearchResult ¶
type ProductSearchResult struct {
ID int64
EnglishTitle string
PersianTitle string
Image string
ExistsStatus ProductExistsStatus
IsActive bool
URL string
Rate int64
MinimumPrice int64
MaximumPrice int64
Likes int64
LastPeriodLikes int64
Views int64
LastPeriodViews int64
IsSpecialOffer bool
RegisteredDateTime time.Time
HasVideo bool
Colors []ProductColor
UserRatingCount int64
Favorites int64
LastPeriodFavorites int64
LastPeriodSales int64
HasGift bool
HTMLDetails string
}
ProductSearchResult is a struct containing a product details for a search result
type SearchResult ¶
type SearchResult struct {
ResponseTime int64
Count int64
Results []ProductSearchResult
}
SearchResult returns a struct containing results of the search for a keyword
func Search ¶
func Search(keyword string) (SearchResult, error)
Search for a product in DGKala and return a slice of DGKala SearchResult items