parse

package
v0.0.0-...-914f43d Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Commit represents a base commit, which is used by output html file directly and indirectly

DailyCommit represents number of commits aggregated by day.

Committer represents number of commits aggregated by Email.

Fetch data via Github API wrapper and convert it to GhAPI.

Issue represents a base issue, which is used by output html file directly and indirectly

FirstIssue indicate issues that has 'good first issue' 'first-timers-only' 'beginner' 'easy' or 'dificulty:easy' label and not closed

IssueStack represent cumulative sum of issue

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient() *github.Client

func GetRepository

func GetRepository(user string, repo string, r *Insight)

func Parse

func Parse(api GhAPI, r *Insight)

Types

type Commit

type Commit struct {
	Name      string
	Email     string
	Date      string
	CommitID  string
	Message   string
	URL       string
	AuthorURL string
	AvatarURL string
}

func NewCommit

func NewCommit(Name string, Email string, Date string, CommitID string, Message string, URL string, AuthorURL string, AvatarURL string) Commit

type Commits

type Commits []Commit

func NewCommits

func NewCommits(rc []*github.RepositoryCommit) (Commits, int)

func (Commits) String

func (c Commits) String() string

type Committer

type Committer struct {
	Name      string
	Email     string
	Amount    int
	Row       int
	URL       string
	AvatarURL string
}

func NewCommitter

func NewCommitter(Name string, Email string, Amount int, Row int, URL string, AvatarURL string) Committer

type Committers

type Committers []Committer

func NewCommitters

func NewCommitters(cl Commits) Committers

func (Committers) Len

func (c Committers) Len() int

func (Committers) Less

func (c Committers) Less(i, j int) bool

func (Committers) String

func (c Committers) String() string

func (Committers) Swap

func (c Committers) Swap(i, j int)

type DailyCommit

type DailyCommit struct {
	Amount   int
	Datetime string
}

func NewDailyCommit

func NewDailyCommit(Amount int, Datetime string) DailyCommit

type DailyCommits

type DailyCommits []DailyCommit

func NewDailyCommits

func NewDailyCommits(cl Commits) (DailyCommits, []string)

func (DailyCommits) Len

func (ca DailyCommits) Len() int

func (DailyCommits) Less

func (ca DailyCommits) Less(i, j int) bool

func (DailyCommits) String

func (c DailyCommits) String() string

func (DailyCommits) Swap

func (ca DailyCommits) Swap(i, j int)

type GhAPI

type GhAPI struct {
	RepoCommit   []*github.RepositoryCommit
	RepoLang     map[string]int
	RateLimit    *github.RateLimits
	RepoInfo     *github.Repository
	RepoAllIss   []*github.Issue
	RepoOpenIss  []*github.Issue
	Readme       *github.RepositoryContent
	Contributing *github.RepositoryContent
}

func (*GhAPI) FetchContent

func (c *GhAPI) FetchContent(user string, repo string, file string) *github.RepositoryContent

func (*GhAPI) FetchIssues

func (c *GhAPI) FetchIssues(user string, repo string, opts *github.IssueListByRepoOptions) []*github.Issue

func (*GhAPI) FetchLanguages

func (c *GhAPI) FetchLanguages(user string, repo string) map[string]int

func (*GhAPI) FetchRateLimit

func (c *GhAPI) FetchRateLimit() *github.RateLimits

func (*GhAPI) FetchRepoCommits

func (c *GhAPI) FetchRepoCommits(user string, repo string, opts *github.CommitsListOptions) []*github.RepositoryCommit

func (*GhAPI) FetchRepository

func (c *GhAPI) FetchRepository(user string, repo string) *github.Repository

type I

type I interface {
	FetchRepoCommits(string, string, *github.CommitsListOptions) []*github.RepositoryCommit
	FetchLanguages(string, string) map[string]int
	FetchRateLimit() *github.RateLimits
	FetchRepository(string, string) *github.Repository
	FetchIssues(string, string, *github.IssueListByRepoOptions) []*github.Issue
	FetchContent(string, string, string) *github.RepositoryContent
}

type Info

type Info struct {
	Name        string
	AvatarURL   string
	Language    string
	Description string
	HomePage    string
	License     string
	LicenseURL  string
	Stars       int
	Forks       int
	IsFork      bool
	Size        int
	Issues      int
	CreatedAt   string
	UpdatedAt   string
}

func NewInfo

func NewInfo(r *github.Repository) Info

type Insight

type Insight struct {
	User            string
	RepoName        string
	Author          []string
	Info            Info
	RateLimits      *github.RateLimits
	GeneratedAt     string
	CommitCount     int
	IssueCount      int
	Languages       Languages
	Committers      Committers
	DailyCommits    DailyCommits
	LatestCommit    Commits
	LatestIssues    Issues
	FirstIssues     Issues
	FirstIssueCount int
	IssueStack      IssueStack
	Readme          string
	Contributing    string
}

type Issue

type Issue struct {
	Title     string
	URL       string
	User      string
	UserURL   string
	AvatarURL string
	Label     map[string]string
	State     string
	CreatedAt string
	ClosedAt  string
	Body      string
}

TODO: make namespace match the Commit one

type IssueStack

type IssueStack map[string]int

func NewIssueStack

func NewIssueStack(repoIss []*github.Issue) IssueStack

type Issues

type Issues []Issue

func NewFirstIssues

func NewFirstIssues(repoIss []*github.Issue) (Issues, int)

func NewOpenIssues

func NewOpenIssues(repoIss []*github.Issue) (Issues, int)

type Language

type Language struct {
	Name   string
	Amount int
}

type Languages

type Languages []Language

func NewLanguages

func NewLanguages(m map[string]int) Languages

func (Languages) Len

func (c Languages) Len() int

func (Languages) Less

func (c Languages) Less(i, j int) bool

func (Languages) Swap

func (c Languages) Swap(i, j int)

type Service

type Service struct {
	Client I
}

func (*Service) Get

func (s *Service) Get(user string, repo string) GhAPI

Jump to

Keyboard shortcuts

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