trending

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2018 License: MIT Imports: 3 Imported by: 6 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func (t *Trend) GetTimeFrames() []string

GetTimeFrames returns all available timeframes of go-trending package.

func (*Trend) GetTrendingLanguages

func (t *Trend) GetTrendingLanguages() []string

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

Jump to

Keyboard shortcuts

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