stat

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart added in v1.0.1

type Chart struct {
	Data   []float64 `json:"data"`
	Labels []string  `json:"labels"`
}

type CommitList added in v1.0.1

type CommitList []*github.RepositoryCommit

func (CommitList) Chart added in v1.0.1

func (c CommitList) Chart() Chart

type Data

type Data struct {
	Age                  string `json:"age"`
	AvgReleasePeriod     string `json:"avgReleasePeriod,omitempty"`
	ContributorCount     string `json:"contributorCount,omitempty"`
	ForkCount            string `json:"forkCount,omitempty"`
	FullName             string `json:"fullName,omitempty"`
	Homepage             string `json:"homepage,omitempty"`
	Issue                string `json:"issue"`
	Language             string `json:"language,omitempty"`
	LastPushedAt         string `json:"lastPushedAt"`
	LatestReleaseAt      string `json:"latestReleaseAt"`
	LastUpdatedAt        string `json:"lastUpdatedAt"`
	LatestDayStarCount   string `json:"latestDayStarCount"`
	LatestMonthStarCount string `json:"latestMonthStarCount"`
	LatestWeekStarCount  string `json:"latestWeekStarCount"`
	License              string `json:"license,omitempty"`
	Pull                 string `json:"pull"`
	ReleaseCount         string `json:"releaseCount,omitempty"`
	StarCount            string `json:"starCount,omitempty"`
	WatcherCount         string `json:"watcherCount,omitempty"`

	Description           string   `json:"description,omitempty"`
	Tags                  []string `json:"tags,omitempty"`
	LatestMonthStargazers Chart    `json:"latestMonthStargazers"`

	LatestWeekForks   Chart `json:"latestWeekForks"`
	LatestWeekCommits Chart `json:"latestWeekCommits"`
	LatestWeekPulls   Chart `json:"latestWeekPulls"`
	LatestWeekIssues  Chart `json:"latestWeekIssues"`
}

func Overview

func Overview(accessToken string, renderColor bool, repos ...string) []Data

type Fork added in v1.0.1

type Fork struct {
	List RepositoryConnection `graphql:"forks(first: 100, orderBy: $orderBy, after: $after)"`
}

type ForkQuery added in v1.0.1

type ForkQuery struct {
	Forks Fork `graphql:"repository(owner: $owner, name: $name)"`
}

type ForkRepository added in v1.0.1

type ForkRepository struct {
	CreatedAt githubv4.DateTime
}

type Forks added in v1.0.1

type Forks []RepositoryEdge

func (Forks) Chart added in v1.0.1

func (f Forks) Chart() Chart

type Issue

type Issue struct {
	CreatedAt githubv4.DateTime
}

type IssueConnection

type IssueConnection struct {
	Edges      []IssueEdge
	PageInfo   PageInfo
	TotalCount githubv4.Int
}

type IssueEdge added in v1.0.1

type IssueEdge struct {
	Cursor githubv4.String
	Node   Issue
}

type IssueList added in v1.0.1

type IssueList []IssueEdge

func (IssueList) Chart added in v1.0.1

func (i IssueList) Chart() Chart

type IssueQuery

type IssueQuery struct {
	Issue Issues `graphql:"repository(owner: $owner, name: $name)"`
}

type Issues added in v1.0.1

type Issues struct {
	List IssueConnection `graphql:"issues(first: $first, orderBy: $orderBy, after: $after, states: $issueStates)"`
}

type Label added in v1.0.1

type Label struct {
	Name githubv4.String
}

type LabelConnection added in v1.0.1

type LabelConnection struct {
	Nodes []Label
}

type Language

type Language struct {
	Color githubv4.String
	Name  githubv4.String
}

type LanguageConnection

type LanguageConnection struct {
	Nodes []Language
}

type License

type License struct {
	Name githubv4.String
}

type PRQuery

type PRQuery struct {
	PullRequest PullRequest `graphql:"repository(owner: $owner, name: $name)"`
}

type PageInfo

type PageInfo struct {
	EndCursor       githubv4.String
	HasNextPage     githubv4.Boolean
	HasPreviousPage githubv4.Boolean
	StartCursor     githubv4.String
}

type PullRequest

type PullRequest struct {
	List PullRequestConnection `graphql:"pullRequests(first: $first, orderBy: $orderBy, after: $after, states: $pullRequestStates)"`
}

type PullRequestConnection

type PullRequestConnection struct {
	Edges      []PullRequestEdge
	PageInfo   PageInfo
	TotalCount githubv4.Int
}

type PullRequestEdge added in v1.0.1

type PullRequestEdge struct {
	Cursor githubv4.String
	Node   PullRequestNode
}

type PullRequestList added in v1.0.1

type PullRequestList []PullRequestEdge

func (PullRequestList) Chart added in v1.0.1

func (p PullRequestList) Chart() Chart

type PullRequestNode added in v1.0.1

type PullRequestNode struct {
	CreatedAt githubv4.DateTime
}

type Release

type Release struct {
	CreatedAt   githubv4.DateTime
	PublishedAt githubv4.DateTime
}

type ReleaseConnection

type ReleaseConnection struct {
	TotalCount githubv4.Int
}

type Repository

type Repository struct {
	CreatedAt        githubv4.DateTime
	ForkCount        githubv4.Int
	HomepageUrl      githubv4.URI
	Issues           IssueConnection `graphql:"issues(first: 1, states: $issueStates)"`
	LatestRelease    Release
	LicenseInfo      License
	PrimaryLanguage  Language
	NameWithOwner    githubv4.String
	PullRequests     PullRequestConnection `graphql:"pullRequests(first: 1, states: $pullRequestStates)"`
	PushedAt         githubv4.DateTime
	Releases         ReleaseConnection `graphql:"releases(first: 1, orderBy: $orderBy)"`
	StargazerCount   githubv4.Int
	UpdatedAt        githubv4.DateTime
	Watchers         UserConnection `graphql:"watchers(first: 1)"`
	Description      githubv4.String
	RepositoryTopics RepositoryTopicConnection `graphql:"repositoryTopics(first: 100)"`
}

type RepositoryCollaboratorConnection

type RepositoryCollaboratorConnection struct {
	TotalCount githubv4.Int
}

type RepositoryConnection added in v1.0.1

type RepositoryConnection struct {
	Edges      []RepositoryEdge
	PageInfo   PageInfo
	TotalCount githubv4.Int
}

type RepositoryEdge added in v1.0.1

type RepositoryEdge struct {
	Cursor githubv4.String
	Node   ForkRepository
}

type RepositoryQuery

type RepositoryQuery struct {
	Repository Repository `graphql:"repository(owner: $owner, name: $name)"`
}

type RepositoryTopic added in v1.0.1

type RepositoryTopic struct {
	Topic Topic
}

type RepositoryTopicConnection added in v1.0.1

type RepositoryTopicConnection struct {
	Nodes []RepositoryTopic
}

func (RepositoryTopicConnection) List added in v1.0.1

func (t RepositoryTopicConnection) List() []string

type Stargazer

type Stargazer struct {
	Stargazers StargazerConnection `graphql:"stargazers(first: 100, orderBy: $orderBy, after: $after)"`
}

type StargazerConnection

type StargazerConnection struct {
	Edges      []StargazerEdge
	PageInfo   PageInfo
	TotalCount githubv4.Int
}

type StargazerEdge

type StargazerEdge struct {
	Cursor    githubv4.String
	StarredAt githubv4.DateTime
}

type StargazerEdges

type StargazerEdges []StargazerEdge

func (StargazerEdges) Chart added in v1.0.1

func (s StargazerEdges) Chart() Chart

func (StargazerEdges) LatestDayStars

func (s StargazerEdges) LatestDayStars() (int, int)

func (StargazerEdges) LatestMonthStars

func (s StargazerEdges) LatestMonthStars() int

func (StargazerEdges) LatestWeekStars

func (s StargazerEdges) LatestWeekStars() (int, int)

type StargazerQuery

type StargazerQuery struct {
	Stargazer Stargazer `graphql:"repository(owner: $owner, name: $name)"`
}

type Stat

type Stat struct {
	// contains filtered or unexported fields
}

func NewStat

func NewStat(repo string, accessToken ...string) *Stat

func (Stat) ContributorCount

func (s Stat) ContributorCount() int

func (Stat) GetTotal

func (s Stat) GetTotal(resp *github.Response) int

func (Stat) LatestWeekIssues added in v1.0.1

func (s Stat) LatestWeekIssues() IssueList

func (Stat) OpenIssueCount

func (s Stat) OpenIssueCount() githubv4.Int

func (Stat) OpenPullRequestCount

func (s Stat) OpenPullRequestCount() githubv4.Int

func (Stat) Repository

func (s Stat) Repository() Repository

type Topic added in v1.0.1

type Topic struct {
	Name githubv4.String
}

type UserConnection

type UserConnection struct {
	TotalCount githubv4.Int
}

Jump to

Keyboard shortcuts

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