Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trend ¶
type Trend struct {
Client TrendingAPI
}
Trend is the data structure to hold a github-trending client. This will be used to retrieve trending projects
func NewClient ¶ added in v0.4.0
func NewClient() *Trend
NewClient will provide a new instance of Trend.
func (*Trend) GetRandomProjectGenerator ¶
func (t *Trend) GetRandomProjectGenerator(timeFrame, language string) func() (trending.Project, error)
GetRandomProjectGenerator returns a closure to retrieve a random project based on timeFrame. timeFrame is a string based on the timeframes provided by go-trending or GetTimeFrames. language is a (programing) language provided by go-trending. Can be empty as well.
func (*Trend) GetTimeFrames ¶
GetTimeFrames returns all available timeframes of go-trending package.
func (*Trend) GetTrendingLanguages ¶
GetTrendingLanguages returns all trending languages, but only the URLNames, because this is what we need. Errors are not important here.
type TrendingAPI ¶
type TrendingAPI interface { GetTrendingLanguages() ([]trending.Language, error) GetProjects(time, language string) ([]trending.Project, error) }
TrendingAPI represents the interface to the github.com/trending website