types

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func CategoryIndexBySlug(slug string) int

CategoryIndexBySlug returns the index of the category with the given slug in AllCategories, or -1 if not found.

Types

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

CategoryLink represents a link to a product category.

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

const (
	Daily Period = iota
	Weekly
	Monthly
)

func (Period) String

func (p Period) String() string

String returns the string representation of the period

func (Period) URLPath

func (p Period) URLPath(date time.Time) string

URLPath returns the Product Hunt leaderboard URL path for the given date Daily: /leaderboard/daily/YYYY/M/DD (month and day without leading zeros) Weekly: /leaderboard/weekly/YYYY/W (ISO week number) Monthly: /leaderboard/monthly/YYYY/M (month without leading zero)

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

func NewProConTag(name, tagType string, count int) ProConTag

NewProConTag creates a new ProConTag

func (ProConTag) Count added in v0.0.3

func (t ProConTag) Count() int

func (ProConTag) Name added in v0.0.3

func (t ProConTag) Name() string

Getters for ProConTag fields

func (ProConTag) TagType added in v0.0.3

func (t ProConTag) TagType() string

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 (p Product) Categories() []string

func (Product) CommentCount

func (p Product) CommentCount() int

func (Product) Description

func (p Product) Description() string

func (Product) FilterValue

func (p Product) FilterValue() string

func (Product) Name

func (p Product) Name() string

Getters for Product fields

func (Product) Rank

func (p Product) Rank() int

func (Product) Slug

func (p Product) Slug() string

func (Product) Tagline

func (p Product) Tagline() string

func (Product) ThumbnailURL

func (p Product) ThumbnailURL() string

func (Product) Title

func (p Product) Title() string

list.Item interface implementation

func (Product) VoteCount

func (p Product) VoteCount() int

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 (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.

Jump to

Keyboard shortcuts

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