github

package
v0.0.0-...-7c2d22d Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndPrintRateLimit

func CheckAndPrintRateLimit()

CheckAndPrintRateLimit accesses Github's API to check current limits

func GetActiveForkersPercentage

func GetActiveForkersPercentage(contributors int, forkers int) float64

GetActiveForkersPercentage calculates the percentage of active forkers of the repository

func GetClosedIssuesPercentage

func GetClosedIssuesPercentage(openIssues int, closedIssues int) float64

GetClosedIssuesPercentage calculates the percentage of closed issues of the repository

func GetCommitsByDay

func GetCommitsByDay(totalCommits int, repositoryAge int) float64

GetCommitsByDay calculates the rate of commits by day of the repository

func GetIssueByDay

func GetIssueByDay(totalIssues int, age int) float64

GetIssueByDay calculates the rate of issues by day of the repository

func GetRepositoryClosedIssues

func GetRepositoryClosedIssues(repoKey string, tmpFolder string, debug bool) int

GetRepositoryClosedIssues gets number of closed issues of a repository

func GetRepositoryCommitsData

func GetRepositoryCommitsData(repoKey string, tmpFolder string, debug bool) (string, time.Time)

GetRepositoryCommitsData gets information about commits of a repository. Currerntly used for author login and last commit date

func GetRepositoryContributors

func GetRepositoryContributors(repoKey string, tmpFolder string, debug bool) (int, int)

GetRepositoryContributors gets information about contributors of the repository

func GetRepositoryLanguages

func GetRepositoryLanguages(RepoKey string, tmpFolder string, debug bool) (string, int)

GetRepositoryLanguages gets repository language statistics

func GetRepositoryTagsNumber

func GetRepositoryTagsNumber(repoKey string, tmpFolder string, debug bool) int

GetRepositoryTagsNumber gets information about tags of the repository

func GetUserFollowers

func GetUserFollowers(username string, tmpFolder string, debug bool) int

GetUserFollowers gets information about followers of a user

Types

type Commit

type Commit struct {
	Author struct {
		Login string `json:"login"`
		Date  string `json:"date"`
	} `json:"author"`
	Commit struct {
		Author struct {
			Name  string    `json:"name"`
			Email string    `json:"email"`
			Date  time.Time `json:"date"`
		} `json:"author"`
	} `json:"commit"`
}

Commit structure with selcted data keys for JSON processing

type ContributionStatistics

type ContributionStatistics struct {
	TotalCommits              int
	TotalAdditions            int
	TotalDeletions            int
	TotalCodeChanges          int
	MediumCommitSize          int
	AverageContributionPeriod int
	ReturningContributors     int
}

ContributionStatistics contains multiple statistics about contribution into the repository

func GetContributionStatistics

func GetContributionStatistics(repoKey string, tmpFolder string, debug bool) ContributionStatistics

GetContributionStatistics gets detailsed statistics about contributors of the repository

type Contributor

type Contributor struct {
	Login string `json:"login"`
}

Contributor structure with selcted data keys for JSON processing

type Language

type Language struct {
	Language string
	Size     float64
}

Language with size

type LanguageList

type LanguageList []Language

LanguageList contains all languages

func (LanguageList) Len

func (l LanguageList) Len() int

func (LanguageList) Less

func (l LanguageList) Less(i, j int) bool

func (LanguageList) Swap

func (l LanguageList) Swap(i, j int)

type Repository

type Repository struct {
	Name        string    `json:"name"`
	FullName    string    `json:"full_name"`
	Language    string    `json:"language"`
	Description string    `json:"description"`
	Watchers    int       `json:"watchers"`
	Forks       int       `json:"forks"`
	OpenIssues  int       `json:"open_issues"`
	CreatedAt   time.Time `json:"created_at"`
	HasIssues   bool      `json:"has_issues"`
	License     struct {
		SPDXID string `json:"spdx_id"`
	} `json:"license"`
}

Repository structure with selcted data keys for JSON processing

func GetRepositoryStatistics

func GetRepositoryStatistics(RepoKey string, tmpFolder string, debug bool) *Repository

GetRepositoryStatistics gets repository common statistics

func ParseRepositoryData

func ParseRepositoryData(jsonResponse []byte) *Repository

ParseRepositoryData is used to parse repository common statistics

type StatsContributor

type StatsContributor struct {
	Author struct {
		Login string `json:"login"`
	} `json:"author"`
	TotalCommits int `json:"total"`
	Weeks        []struct {
		Week      int `json:"w"`
		Additions int `json:"a"`
		Deletions int `json:"d"`
		Commits   int `json:"c"`
	} `json:"weeks"`
}

StatsContributor contains statistical data for contribution

type Tag

type Tag struct {
	Name string `json:"name"`
}

Tag structure with selcted data keys for JSON processing

type User

type User struct {
	Login     string    `json:"login"`
	Name      string    `json:"name"`
	Location  string    `json:"location"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
}

User structure with selcted data keys for JSON processing

func GetUserData

func GetUserData(username string, tmpFolder string, debug bool) *User

GetUserData gets information about followers of a user

Jump to

Keyboard shortcuts

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