Documentation ¶
Index ¶
- Constants
- Variables
- type Asset
- type Author
- type Branch
- type Client
- func (c *Client) CompareTwoCommit(base, head string, page, perPage int) (*CompareTwoCommit, 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, perPage int, fn FetchBranchCallback) error
- func (c *Client) FetchCommitRef(sha string, page, perPage int, fn FetchCommitRefCallback) error
- func (c *Client) FetchRelease(page, perPage 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(page, perPage int) (*ListBranches, error)
- func (c *Client) ListBranchesOfCommit(sha string, branchesPerPage, commitsPerPage int) ([]*Branch, error)
- func (c *Client) ListCommitRefs(sha string, page, perPage int) (*ListCommitRefs, error)
- func (c *Client) ListReleases(page, perPage 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
- type CommitAuthor
- type CommitRef
- type CompareTwoCommit
- type FetchBranchCallback
- type FetchCommitRefCallback
- type FetchReleaseCallback
- type ListBranches
- type ListCommitRefs
- type ListReleases
- type Release
Constants ¶
View Source
const GITHUB_API_URL = "https://api.github.com"
Variables ¶
View Source
var ReLinkNext = regexp.MustCompile(`<([^>]+)>; rel="next"`)
ReLinkNext is used to check the Link header
<https://api.github.com/repositories/194783954/releases?per_page=1&page=2>; rel=\"next\"
View Source
var ReMultipleSlashes = regexp.MustCompile("/+")
View Source
var ReOwnerName = regexp.MustCompile(`^[A-Za-z0-9-]+$`)
View Source
var ReRepoName = regexp.MustCompile(`^[\w-][\w.-]*$`)
View Source
var ReUploadURLSuffix = regexp.MustCompile("/assets[^/]*$")
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct { ID int `json:"id"` Name string `json:"name"` Label string `json:"label"` ContentType string `json:"content_type"` Size int `json:"size"` URL string `json:"url"` BrowserDownloadURL string `json:"browser_download_url"` DownloadCount int `json:"download_count"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Uploader Author `json:"uploader"` }
type Client ¶
func (*Client) CompareTwoCommit ¶ added in v0.5.0
func (c *Client) CompareTwoCommit(base, head string, page, perPage int) (*CompareTwoCommit, error)
func (*Client) CreateRelease ¶
func (*Client) DeleteRelease ¶
func (*Client) FetchBranch ¶
func (c *Client) FetchBranch(page, perPage int, fn FetchBranchCallback) error
func (*Client) FetchCommitRef ¶
func (c *Client) FetchCommitRef(sha string, page, perPage int, fn FetchCommitRefCallback) error
func (*Client) FetchRelease ¶
func (c *Client) FetchRelease(page, perPage int, fn FetchReleaseCallback) error
func (*Client) GetReleaseByTagName ¶
func (*Client) GetReleaseLatest ¶
func (*Client) ListBranches ¶
func (c *Client) ListBranches(page, perPage int) (*ListBranches, error)
func (*Client) ListBranchesOfCommit ¶
func (*Client) ListCommitRefs ¶
func (c *Client) ListCommitRefs(sha string, page, perPage int) (*ListCommitRefs, error)
func (*Client) ListReleases ¶
func (c *Client) ListReleases(page, perPage int) (*ListReleases, error)
func (*Client) PostUpload ¶
type Commit ¶
type Commit struct { URL string `json:"url"` CommitAuthor CommitAuthor `json:"author"` Committer CommitAuthor `json:"committer"` Message string `json:"message"` }
type CommitAuthor ¶
type CompareTwoCommit ¶ added in v0.5.0
type CompareTwoCommit struct { HtmlURL string `json:"html_url` BaseCommit CommitRef `json:"base_commit"` MergeBaseCommit CommitRef `json:"merge_base_commit"` Status string `json:"status"` AheadBy int `json:"ahead_by"` BehindBy int `json:"behind_by"` TotalCommits int `json:"total_commits"` Commits []*CommitRef `json:"commits"` NextPage int }
type FetchBranchCallback ¶
type FetchCommitRefCallback ¶
type FetchReleaseCallback ¶
type ListBranches ¶
type ListCommitRefs ¶
type ListReleases ¶
type Release ¶
type Release struct { ID int `json:"id"` Draft bool `json:"draft"` PreRelease bool `json:"prerelease"` Name string `json:"name"` Body string `json:"body"` TagName string `json:"tag_name"` TargetCommitish string `json:"target_commitish"` HtmlURL string `json:"html_url,omitempty"` UploadURL string `json:"upload_url,omitempty"` CreatedAt string `json:"created_at,omitempty"` PublishedAt string `json:"published_at,omitempty"` Author Author `json:"author,omitempty"` Assets []Asset `json:"assets,omitempty"` }
Click to show internal directories.
Click to hide internal directories.