githubpotentials

package module
v0.0.0-...-139ac2d Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2016 License: MIT Imports: 6 Imported by: 0

README

Github Potentials

Github Potentials command line tool is package that allows you to find rising Github repositories in 3 steps:

  • Fetch recently updated repositories (up to 1k).
  • Count stats for last n hours/days: new stars, unique contributors and commits.
  • Sort by selected criteria and take the best.
Command line tool

Under cmd/ghp directory you can see an example of using this package.

go get github.com/artisresistance/githubpotentials/cmd/ghp

You must provide config file that contains your Github API secret token. Example output you can find here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorHandler

type ErrorHandler func(error)

ErrorHandler callback allows you to catch/log/report errors.

type Potentials

type Potentials interface {
	Search(int) RepositoryChannel
	CountStats(RepositoryChannel) RepositoryChannel
	APIRates() (remaining int, reset time.Time, err error)
}

Potentials is main worker of package.

func New

func New(token string, since time.Time, log *log.Logger) Potentials

New returns new instance of package. token - github api token.

type RepositoryChannel

type RepositoryChannel chan *github.Repository

func (RepositoryChannel) Dump

func (RepositoryChannel) FilterZeroStats

func (in RepositoryChannel) FilterZeroStats(criteria SortCriteria) RepositoryChannel

func (RepositoryChannel) Split

func (in RepositoryChannel) Split(count int) []RepositoryChannel

type RepositoryCollection

type RepositoryCollection []github.Repository

func (RepositoryCollection) Sort

func (RepositoryCollection) Trim

type SortCriteria

type SortCriteria int

SortCriteria enum defines all available criteria of generating result.

const (
	CommitsCriteria SortCriteria = iota
	StarsCriteria
	ContributorsCriteria
	CombinedCriteria
	NoCriteria
)

All available sort criteria.

func (SortCriteria) String

func (sc SortCriteria) String() string

Directories

Path Synopsis
cmd
ghp

Jump to

Keyboard shortcuts

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