github

package module
v0.0.0-...-680ec49 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

Stars

Compare stargazers across two projects on GitHub.

Install

go get github.com/harshavardhana/github/stars

Usage

Generate an output.svg a comparison chart for minio/minio v/s mongodb/mongo.

stars -mode=file -repos="minio/minio,mongodb/mongo" output.svg

With GitHub token

export GITHUB_TOKEN=xxxxxxxxxxx
stars -repos="minio/minio,mongodb/mongo" output.svg

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

type GitHub struct {
	Token    string
	PageSize int
}

GitHub client struct

func (*GitHub) RepoInfo

func (gh *GitHub) RepoInfo(name string) (repo RepoInfo, err error)

RepoInfo gets the given repository info.

func (*GitHub) Stargazers

func (gh *GitHub) Stargazers(repo RepoInfo) (stars []Stargazer, err error)

Stargazers returns all the stargazers of a given repo the date and time when they were starred at. Additionally also provides user name as well.

type RepoInfo

type RepoInfo struct {
	FullName        string `json:"full_name"`
	StargazersCount int    `json:"stargazers_count"`
	CreatedAt       string `json:"created_at"`
}

RepoInfo get repository info.

type Stargazer

type Stargazer struct {
	StarredAt time.Time `json:"starred_at"`
	User      struct {
		Name string `json:"login"`
		Type string `json:"type"`
	} `json:"user"`
}

Stargazer is a star on a project at a given time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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