Versions in this module Expand all Collapse all v0 v0.5.0 May 4, 2021 Changes in this version type Client + func (c *Client) CompareTwoCommit(base, head string, page, perPage int) (*CompareTwoCommit, error) + type CompareTwoCommit struct + AheadBy int + BaseCommit CommitRef + BehindBy int + Commits []*CommitRef + HtmlURL string + MergeBaseCommit CommitRef + NextPage int + Status string + TotalCommits int v0.4.1 Apr 30, 2021 v0.4.0 Apr 28, 2021 v0.3.1 Apr 28, 2021 v0.3.0 Apr 27, 2021 v0.2.0 Apr 27, 2021 Changes in this version + const GITHUB_API_URL + var ReLinkNext = regexp.MustCompile(`<([^>]+)>; rel="next"`) + var ReMultipleSlashes = regexp.MustCompile("/+") + var ReOwnerName = regexp.MustCompile(`^[A-Za-z0-9-]+$`) + var ReRepoName = regexp.MustCompile(`^[\w-][\w.-]*$`) + var ReUploadURLSuffix = regexp.MustCompile("/assets[^/]*$") + type Asset struct + BrowserDownloadURL string + ContentType string + CreatedAt string + DownloadCount int + ID int + Label string + Name string + Size int + URL string + UpdatedAt string + Uploader Author + type Author struct + AvatarURL string + HtmlURL string + ID int + Login string + SiteAdmin bool + Type string + type Branch struct + Name string + Protected bool + type Client struct + Body io.Reader + Header http.Header + func New(ctx context.Context, repo string) (*Client, error) + func (c *Client) CreateRelease(tagName, targetCommitish, name, body string, draft, prerelease bool) (*Release, error) + func (c *Client) Delete(endpoint string) (*http.Response, error) + func (c *Client) DeleteRelease(id int) error + func (c *Client) DeleteTag(tag string) error + func (c *Client) DownloadAsset(id int, pathname string) error + func (c *Client) FetchBranch(page, itemsPerPage int, fn FetchBranchCallback) error + func (c *Client) FetchCommitRef(page, itemsPerPage int, sha string, fn FetchCommitRefCallback) error + func (c *Client) FetchRelease(page, itemsPerPage int, fn FetchReleaseCallback) error + func (c *Client) Get(endpoint string) (*http.Response, error) + func (c *Client) GetBranch(name string) (*Branch, error) + func (c *Client) GetRelease(id int) (*Release, error) + func (c *Client) GetReleaseByTagName(tag string) (*Release, error) + func (c *Client) GetReleaseLatest() (*Release, error) + func (c *Client) ListBranches(nitem, page int) (*ListBranches, error) + func (c *Client) ListBranchesOfCommit(s string, branchesPerPage, commitsPerPage int) ([]*Branch, error) + func (c *Client) ListCommitRefs(nitem, page int, sha string) (*ListCommitRefs, error) + func (c *Client) ListReleases(nitem, page int) (*ListReleases, error) + func (c *Client) Post(endpoint string) (*http.Response, error) + func (c *Client) PostUpload(endpoint string, body io.Reader, size int64, mime string) (*http.Response, error) + func (c *Client) SetToken(token string) + func (c *Client) SetURL(s string) error + type Commit struct + CommitAuthor CommitAuthor + Committer CommitAuthor + Message string + URL string + type CommitAuthor struct + Date string + Email string + Name string + type CommitRef struct + Author Author + Commit Commit + Committer Author + HtmlURL string + SHA string + URL string + type FetchBranchCallback func(v *Branch, page int) error + type FetchCommitRefCallback func(v *CommitRef, page int) error + type FetchReleaseCallback func(v *Release, page int) error + type ListBranches struct + Branches []*Branch + NextPage int + type ListCommitRefs struct + CommitRefs []*CommitRef + NextPage int + type ListReleases struct + NextPage int + Releases []*Release + type Release struct + Assets []Asset + Author Author + Body string + CreatedAt string + Draft bool + HtmlURL string + ID int + Name string + PreRelease bool + PublishedAt string + TagName string + TargetCommitish string + UploadURL string + func (r *Release) UploadAsset(c *Client, name string, body io.Reader, size int64, mime string) error