Documentation ¶
Index ¶
- Constants
- func AddQuery(query []string, queryParts ...string) []string
- func GetCurrentBranch() (string, error)
- func GetSha256(filename string) (string, error)
- func HasLabel(i *github.Issue, label string) bool
- func IsVer(version string, t string) bool
- func ReadToken(filename string) (string, error)
- func RenderProgressBar(progress, total int, duration string, initRender bool)
- func Shell(name string, arg ...string) (string, error)
- type GithubClient
- func (g GithubClient) GetBranch(ctx context.Context, owner, repo, branch string) (*github.Branch, *github.Response, error)
- func (g GithubClient) GetCommitDate(owner, repo, tagCommit string, tags []*github.RepositoryTag) (time.Time, error)
- func (g GithubClient) LastReleases(owner, repo string) (map[string]string, error)
- func (g GithubClient) ListAllCommits(owner, repo, branch string, start, end time.Time) ([]*github.RepositoryCommit, error)
- func (g GithubClient) ListAllIssues(owner, repo string) ([]*github.Issue, error)
- func (g GithubClient) ListAllReleases(owner, repo string) ([]*github.RepositoryRelease, error)
- func (g GithubClient) ListAllTags(owner, repo string) ([]*github.RepositoryTag, error)
- func (g GithubClient) SearchIssues(query string) ([]github.Issue, error)
Constants ¶
const (
// GithubRawURL is the url prefix for getting raw github user content.
GithubRawURL = "https://raw.githubusercontent.com/"
)
Variables ¶
This section is empty.
Functions ¶
func GetCurrentBranch ¶
GetCurrentBranch gets the branch name where the program is called.
func IsVer ¶
IsVer checks if input version number matches input version type among: "dotzero" The function returns true if the version number matches the version type; returns false otherwise.
func RenderProgressBar ¶
RenderProgressBar renders a progress bar by rewriting the current (assuming stdout outputs to a terminal console). If initRender is true, the function writes a new line instead of rewrite the current line.
Types ¶
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
GithubClient wraps github client with methods in this file.
func NewClient ¶
func NewClient(githubToken string) *GithubClient
NewClient sets up a new github client with input assess token.
func (GithubClient) GetBranch ¶
func (g GithubClient) GetBranch(ctx context.Context, owner, repo, branch string) (*github.Branch, *github.Response, error)
GetBranch is a wrapper of Github GetBranch function.
func (GithubClient) GetCommitDate ¶
func (g GithubClient) GetCommitDate(owner, repo, tagCommit string, tags []*github.RepositoryTag) (time.Time, error)
GetCommitDate gets commit time for given tag/commit, provided with repository tags and commits. The function returns non-nil error if input tag/commit cannot be found in the repository.
func (GithubClient) LastReleases ¶
func (g GithubClient) LastReleases(owner, repo string) (map[string]string, error)
LastReleases looks up the list of releases on github and puts the last release per branch into a branch-indexed dictionary.
func (GithubClient) ListAllCommits ¶
func (g GithubClient) ListAllCommits(owner, repo, branch string, start, end time.Time) ([]*github.RepositoryCommit, error)
ListAllCommits lists all commits for given owner, repo, branch and time range.
func (GithubClient) ListAllIssues ¶
func (g GithubClient) ListAllIssues(owner, repo string) ([]*github.Issue, error)
ListAllIssues lists all issues and PRs for given owner and repo.
func (GithubClient) ListAllReleases ¶
func (g GithubClient) ListAllReleases(owner, repo string) ([]*github.RepositoryRelease, error)
ListAllReleases lists all releases for given owner and repo.
func (GithubClient) ListAllTags ¶
func (g GithubClient) ListAllTags(owner, repo string) ([]*github.RepositoryTag, error)
ListAllTags lists all tags for given owner and repo.
func (GithubClient) SearchIssues ¶
func (g GithubClient) SearchIssues(query string) ([]github.Issue, error)
SearchIssues gets all issues matching search query. NOTE: Github Search API has tight rate limit (30 requests per minute) and only returns the first 1,000 results. The function waits if it hits the rate limit, and reconstruct the search query with "created:<=YYYY-MM-DD" to search for issues out of the first 1,000 results.