Documentation
¶
Index ¶
- Variables
- func CategoryIndexBySlug(slug string) int
- type CategoryLink
- type LeaderboardEntry
- type Period
- type ProConTag
- type Product
- func (p Product) Categories() []string
- func (p Product) CommentCount() int
- func (p Product) Description() string
- func (p Product) FilterValue() string
- func (p Product) Name() string
- func (p Product) Rank() int
- func (p Product) Slug() string
- func (p Product) Tagline() string
- func (p Product) ThumbnailURL() string
- func (p Product) Title() string
- func (p Product) VoteCount() int
- type ProductDetail
- func (pd ProductDetail) Categories() []string
- func (pd ProductDetail) Description() string
- func (pd ProductDetail) FollowerCount() int
- func (pd ProductDetail) LaunchDate() time.Time
- func (pd ProductDetail) MakerComment() string
- func (pd ProductDetail) MakerName() string
- func (pd ProductDetail) MakerProfileURL() string
- func (pd ProductDetail) PricingInfo() string
- func (pd ProductDetail) ProConTags() []ProConTag
- func (pd ProductDetail) Product() Product
- func (pd ProductDetail) Rating() float64
- func (pd ProductDetail) ReviewCount() int
- func (pd ProductDetail) SocialLinks() []string
- func (pd ProductDetail) WebsiteURL() string
- type ProductSource
Constants ¶
This section is empty.
Variables ¶
var AllCategories = []CategoryLink{}/* 244 elements not displayed */
AllCategories is the complete list of Product Hunt categories. Extracted from https://www.producthunt.com/categories (248 categories). Used for h/l navigation to cycle through all categories.
Functions ¶
func CategoryIndexBySlug ¶ added in v0.0.3
CategoryIndexBySlug returns the index of the category with the given slug in AllCategories, or -1 if not found.
Types ¶
type CategoryLink ¶ added in v0.0.3
type CategoryLink struct {
// contains filtered or unexported fields
}
CategoryLink represents a link to a product category.
func NewCategoryLink ¶ added in v0.0.3
func NewCategoryLink(name, slug string) CategoryLink
NewCategoryLink creates a new CategoryLink
func (CategoryLink) Name ¶ added in v0.0.3
func (c CategoryLink) Name() string
Getters for CategoryLink fields
func (CategoryLink) Slug ¶ added in v0.0.3
func (c CategoryLink) Slug() string
type LeaderboardEntry ¶
type LeaderboardEntry = Product
type Period ¶
type Period int
Period represents the leaderboard time period
type ProConTag ¶ added in v0.0.3
type ProConTag struct {
// contains filtered or unexported fields
}
ProConTag represents an AI-summarized pro or con from user reviews
func NewProConTag ¶ added in v0.0.3
NewProConTag creates a new ProConTag
type Product ¶
type Product struct {
// contains filtered or unexported fields
}
Product represents a PH leaderboard entry
func NewProduct ¶
func NewProduct(name, tagline string, categories []string, voteCount, commentCount int, slug, thumbnailURL string, rank int) Product
NewProduct creates a new Product with the given fields
func (Product) Categories ¶
func (Product) CommentCount ¶
func (Product) Description ¶
func (Product) FilterValue ¶
func (Product) ThumbnailURL ¶
type ProductDetail ¶
type ProductDetail struct {
// contains filtered or unexported fields
}
ProductDetail extends Product with full detail page data
func NewProductDetail ¶
func NewProductDetail(product Product, description string, rating float64, reviewCount, followerCount int, makerComment, websiteURL string, categories, socialLinks []string, launchDate time.Time, makerName, makerProfileURL string, proConTags []ProConTag, pricingInfo string) ProductDetail
NewProductDetail creates a new ProductDetail
func (ProductDetail) Categories ¶
func (pd ProductDetail) Categories() []string
func (ProductDetail) Description ¶
func (pd ProductDetail) Description() string
func (ProductDetail) FollowerCount ¶
func (pd ProductDetail) FollowerCount() int
func (ProductDetail) LaunchDate ¶ added in v0.0.3
func (pd ProductDetail) LaunchDate() time.Time
func (ProductDetail) MakerComment ¶
func (pd ProductDetail) MakerComment() string
func (ProductDetail) MakerName ¶ added in v0.0.3
func (pd ProductDetail) MakerName() string
func (ProductDetail) MakerProfileURL ¶ added in v0.0.3
func (pd ProductDetail) MakerProfileURL() string
func (ProductDetail) PricingInfo ¶ added in v0.0.3
func (pd ProductDetail) PricingInfo() string
func (ProductDetail) ProConTags ¶ added in v0.0.3
func (pd ProductDetail) ProConTags() []ProConTag
func (ProductDetail) Product ¶
func (pd ProductDetail) Product() Product
Getters for ProductDetail fields
func (ProductDetail) Rating ¶
func (pd ProductDetail) Rating() float64
func (ProductDetail) ReviewCount ¶
func (pd ProductDetail) ReviewCount() int
func (ProductDetail) SocialLinks ¶
func (pd ProductDetail) SocialLinks() []string
func (ProductDetail) WebsiteURL ¶
func (pd ProductDetail) WebsiteURL() string
type ProductSource ¶
type ProductSource interface {
GetLeaderboard(period Period, date time.Time) ([]Product, error)
GetProductDetail(slug string) (ProductDetail, error)
GetCategoryProducts(slug string) ([]Product, []CategoryLink, error)
}
ProductSource is the core abstraction for data access. Sync methods only — no bubbletea dependency. Future: MCP server, CLI can call these directly.