{"modulePath":"github.com/Github/hub","version":"v2.9.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package github\n\n## Constants\n\n```go\nconst (\n\tGitHubHost  string = \"github.com\"\n\tOAuthAppURL string = \"https://hub.github.com/\"\n)\n```\n\n```go\nconst (\n\tPullRequestTemplate = \"pull_request_template\"\n\tIssueTemplate       = \"issue_template\"\n)\n```\n\n```go\nconst Scissors = \"------------------------ \u003e8 ------------------------\"\n```\n\n## Variables\n\n```go\nvar (\n\tGitHubHostEnv = os.Getenv(\"GITHUB_HOST\")\n)\n```\n\n```go\nvar (\n\tOriginNamesInLookupOrder = []string{\"upstream\", \"github\", \"origin\"}\n)\n```\n\n```go\nvar UserAgent = \"Hub \" + version.Version\n```\n\n## Functions\n\n```go\nfunc CaptureCrash()\n```\n\n```go\nfunc CheckWriteable(filename string) error\n```\nCheckWriteable checks if config file is writeable. This should be called before asking for credentials and only if current operation needs to update the file. See issue #1314 for details.\n\n```go\nfunc DefaultGitHubHost() string\n```\n\n```go\nfunc FormatError(action string, err error) (ee error)\n```\n\n```go\nfunc IsHttpsProtocol() bool\n```\n\n```go\nfunc ReadTemplate(kind, workdir string) (body string, err error)\n```\n\n```go\nfunc SanitizeProjectName(name string) string\n```\n\n## Types\n\n```go\ntype AuthorizationEntry struct {\n\tToken string `json:\"token\"`\n}\n```\n\n```go\ntype Branch struct {\n\tRepo *GitHubRepo\n\tName string\n}\n```\n\n```go\nfunc (b *Branch) IsMaster() bool\n```\n\n```go\nfunc (b *Branch) IsRemote() bool\n```\n\n```go\nfunc (b *Branch) LongName() string\n```\n\n```go\nfunc (b *Branch) PushTarget(owner string, preferUpstream bool) (branch *Branch)\n```\n\n```go\nfunc (b *Branch) RemoteName() string\n```\n\n```go\nfunc (b *Branch) ShortName() string\n```\n\n```go\nfunc (b *Branch) Upstream() (u *Branch, err error)\n```\n\n```go\ntype CIStatus struct {\n\tState     string `json:\"state\"`\n\tContext   string `json:\"context\"`\n\tTargetUrl string `json:\"target_url\"`\n}\n```\n\n```go\ntype CIStatusResponse struct {\n\tState    string     `json:\"state\"`\n\tStatuses []CIStatus `json:\"statuses\"`\n}\n```\n\n```go\ntype CheckRun struct {\n\tStatus     string `json:\"status\"`\n\tConclusion string `json:\"conclusion\"`\n\tName       string `json:\"name\"`\n\tHtmlUrl    string `json:\"html_url\"`\n}\n```\n\n```go\ntype CheckRunsResponse struct {\n\tCheckRuns []CheckRun `json:\"check_runs\"`\n}\n```\n\n```go\ntype Client struct {\n\tHost *Host\n}\n```\n\n```go\nfunc NewClient(h string) *Client\n```\n\n```go\nfunc NewClientWithHost(host *Host) *Client\n```\n\n```go\nfunc (client *Client) CommitPatch(project *Project, sha string) (patch io.ReadCloser, err error)\n```\n\n```go\nfunc (client *Client) CreateIssue(project *Project, params interface{}) (issue *Issue, err error)\n```\n\n```go\nfunc (client *Client) CreatePullRequest(project *Project, params map[string]interface{}) (pr *PullRequest, err error)\n```\n\n```go\nfunc (client *Client) CreateRelease(project *Project, releaseParams *Release) (release *Release, err error)\n```\n\n```go\nfunc (client *Client) CreateRepository(project *Project, description, homepage string, isPrivate bool) (repo *Repository, err error)\n```\n\n```go\nfunc (client *Client) CurrentUser() (user *User, err error)\n```\n\n```go\nfunc (client *Client) DeleteRelease(release *Release) (err error)\n```\n\n```go\nfunc (client *Client) DeleteReleaseAsset(asset *ReleaseAsset) (err error)\n```\n\n```go\nfunc (client *Client) DeleteRepository(project *Project) error\n```\n\n```go\nfunc (client *Client) DownloadReleaseAsset(url string) (asset io.ReadCloser, err error)\n```\n\n```go\nfunc (client *Client) EditRelease(release *Release, releaseParams map[string]interface{}) (updatedRelease *Release, err error)\n```\n\n```go\nfunc (client *Client) FetchCIStatus(project *Project, sha string) (status *CIStatusResponse, err error)\n```\n\n```go\nfunc (client *Client) FetchComments(project *Project, number string) (comments []Comment, err error)\n```\n\n```go\nfunc (client *Client) FetchIssue(project *Project, number string) (issue *Issue, err error)\n```\n\n```go\nfunc (client *Client) FetchIssues(project *Project, filterParams map[string]interface{}, limit int, filter func(*Issue) bool) (issues []Issue, err error)\n```\n\n```go\nfunc (client *Client) FetchLabels(project *Project) (labels []IssueLabel, err error)\n```\n\n```go\nfunc (client *Client) FetchMilestones(project *Project) (milestones []Milestone, err error)\n```\n\n```go\nfunc (client *Client) FetchPullRequests(project *Project, filterParams map[string]interface{}, limit int, filter func(*PullRequest) bool) (pulls []PullRequest, err error)\n```\n\n```go\nfunc (client *Client) FetchRelease(project *Project, tagName string) (*Release, error)\n```\n\n```go\nfunc (client *Client) FetchReleases(project *Project, limit int, filter func(*Release) bool) (releases []Release, err error)\n```\n\n```go\nfunc (client *Client) FindOrCreateToken(user, password, twoFactorCode string) (token string, err error)\n```\n\n```go\nfunc (client *Client) ForkRepository(project *Project, params map[string]interface{}) (repo *Repository, err error)\n```\n\n```go\nfunc (client *Client) GenericAPIRequest(method, path string, data interface{}, headers map[string]string, ttl int) (*simpleResponse, error)\n```\n\n```go\nfunc (client *Client) GistPatch(id string) (patch io.ReadCloser, err error)\n```\n\n```go\nfunc (client *Client) PullRequest(project *Project, id string) (pr *PullRequest, err error)\n```\n\n```go\nfunc (client *Client) PullRequestPatch(project *Project, id string) (patch io.ReadCloser, err error)\n```\n\n```go\nfunc (client *Client) Repository(project *Project) (repo *Repository, err error)\n```\n\n```go\nfunc (client *Client) RequestReview(project *Project, prNumber int, params map[string]interface{}) (err error)\n```\n\n```go\nfunc (client *Client) UpdateIssue(project *Project, issueNumber int, params map[string]interface{}) (err error)\n```\n\n```go\nfunc (client *Client) UploadReleaseAsset(release *Release, filename, label string) (asset *ReleaseAsset, err error)\n```\n\n```go\ntype Comment struct {\n\tId        int       `json:\"id\"`\n\tBody      string    `json:\"body\"`\n\tUser      *User     `json:\"user\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n}\n```\n\n```go\ntype Config struct {\n\tHosts []*Host `toml:\"hosts\"`\n}\n```\n\n```go\nfunc CreateTestConfigs(user, token string) *Config\n```\nPublic for testing purpose\n\n```go\nfunc CurrentConfig() *Config\n```\n\n```go\nfunc (c *Config) DefaultHost() (host *Host, err error)\n```\n\n```go\nfunc (c *Config) DefaultHostNoPrompt() (*Host, error)\n```\n\n```go\nfunc (c *Config) DetectToken() string\n```\n\n```go\nfunc (c *Config) Find(host string) *Host\n```\n\n```go\nfunc (c *Config) PromptForHost(host string) (h *Host, err error)\n```\n\n```go\nfunc (c *Config) PromptForOTP() string\n```\n\n```go\nfunc (c *Config) PromptForPassword(host, user string) (pass string)\n```\n\n```go\nfunc (c *Config) PromptForUser(host string) (user string)\n```\n\n```go\ntype Editor struct {\n\tProgram string\n\tTopic   string\n\tFile    string\n\tMessage string\n\tCS      string\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewEditor(filename, topic, message string) (editor *Editor, err error)\n```\n\n```go\nfunc (e *Editor) AddCommentedSection(text string)\n```\n\n```go\nfunc (e *Editor) DeleteFile() error\n```\n\n```go\nfunc (e *Editor) EditContent() (content string, err error)\n```\n\n```go\ntype Gist struct {\n\tFiles map[string]GistFile `json:\"files\"`\n}\n```\n\n```go\ntype GistFile struct {\n\tRawUrl string `json:\"raw_url\"`\n}\n```\n\n```go\ntype GitHubRepo struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc LocalRepo() (repo *GitHubRepo, err error)\n```\n\n```go\nfunc (r *GitHubRepo) CurrentBranch() (branch *Branch, err error)\n```\n\n```go\nfunc (r *GitHubRepo) CurrentProject() (project *Project, err error)\n```\n\n```go\nfunc (r *GitHubRepo) DefaultBranch(remote *Remote) *Branch\n```\n\n```go\nfunc (r *GitHubRepo) MainProject() (*Project, error)\n```\n\n```go\nfunc (r *GitHubRepo) MainRemote() (*Remote, error)\n```\n\n```go\nfunc (r *GitHubRepo) MasterBranch() *Branch\n```\n\n```go\nfunc (r *GitHubRepo) RemoteBranchAndProject(owner string, preferUpstream bool) (branch *Branch, project *Project, err error)\n```\n\n```go\nfunc (r *GitHubRepo) RemoteByName(name string) (*Remote, error)\n```\n\n```go\nfunc (r *GitHubRepo) RemoteForProject(project *Project) (*Remote, error)\n```\n\n```go\nfunc (r *GitHubRepo) RemoteForRepo(repo *Repository) (*Remote, error)\n```\n\n```go\nfunc (r *GitHubRepo) UpstreamProject() (project *Project, err error)\n```\n\n```go\ntype GithubHostError struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (e *GithubHostError) Error() string\n```\n\n```go\ntype Host struct {\n\tHost        string `toml:\"host\"`\n\tUser        string `toml:\"user\"`\n\tAccessToken string `toml:\"access_token\"`\n\tProtocol    string `toml:\"protocol\"`\n\tUnixSocket  string `toml:\"unix_socket,omitempty\"`\n}\n```\n\n```go\ntype Issue struct {\n\tNumber int    `json:\"number\"`\n\tState  string `json:\"state\"`\n\tTitle  string `json:\"title\"`\n\tBody   string `json:\"body\"`\n\tUser   *User  `json:\"user\"`\n\n\tPullRequest *PullRequest     `json:\"pull_request\"`\n\tHead        *PullRequestSpec `json:\"head\"`\n\tBase        *PullRequestSpec `json:\"base\"`\n\n\tMergeCommitSha      string `json:\"merge_commit_sha\"`\n\tMaintainerCanModify bool   `json:\"maintainer_can_modify\"`\n\n\tComments  int          `json:\"comments\"`\n\tLabels    []IssueLabel `json:\"labels\"`\n\tAssignees []User       `json:\"assignees\"`\n\tMilestone *Milestone   `json:\"milestone\"`\n\tCreatedAt time.Time    `json:\"created_at\"`\n\tUpdatedAt time.Time    `json:\"updated_at\"`\n\tMergedAt  time.Time    `json:\"merged_at\"`\n\n\tRequestedReviewers []User `json:\"requested_reviewers\"`\n\tRequestedTeams     []Team `json:\"requested_teams\"`\n\n\tApiUrl  string `json:\"url\"`\n\tHtmlUrl string `json:\"html_url\"`\n\n\tClosedBy *User `json:\"closed_by\"`\n}\n```\n\n```go\ntype IssueLabel struct {\n\tName  string `json:\"name\"`\n\tColor string `json:\"color\"`\n}\n```\n\n```go\ntype MessageBuilder struct {\n\tTitle    string\n\tFilename string\n\tMessage  string\n\tEdit     bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (b *MessageBuilder) AddCommentedSection(section string)\n```\n\n```go\nfunc (b *MessageBuilder) Cleanup()\n```\n\n```go\nfunc (b *MessageBuilder) Extract() (title, body string, err error)\n```\n\n```go\ntype Milestone struct {\n\tNumber int    `json:\"number\"`\n\tTitle  string `json:\"title\"`\n}\n```\n\n```go\ntype Project struct {\n\tName     string\n\tOwner    string\n\tHost     string\n\tProtocol string\n}\n```\n\n```go\nfunc NewProject(owner, name, host string) *Project\n```\n\n```go\nfunc NewProjectFromRepo(repo *Repository) (p *Project, err error)\n```\n\n```go\nfunc NewProjectFromURL(url *url.URL) (p *Project, err error)\n```\n\n```go\nfunc (p *Project) GitURL(name, owner string, isSSH bool) (url string)\n```\n\n```go\nfunc (p *Project) SameAs(other *Project) bool\n```\n\n```go\nfunc (p Project) String() string\n```\n\n```go\nfunc (p *Project) WebURL(name, owner, path string) string\n```\n\n```go\ntype PullRequest Issue\n```\n\n```go\nfunc (pr *PullRequest) HasRequestedReviewer(name string) bool\n```\n\n```go\nfunc (pr *PullRequest) HasRequestedTeam(name string) bool\n```\n\n```go\nfunc (pr *PullRequest) IsSameRepo() bool\n```\n\n```go\ntype PullRequestSpec struct {\n\tLabel string      `json:\"label\"`\n\tRef   string      `json:\"ref\"`\n\tSha   string      `json:\"sha\"`\n\tRepo  *Repository `json:\"repo\"`\n}\n```\n\n```go\ntype Release struct {\n\tName            string         `json:\"name\"`\n\tTagName         string         `json:\"tag_name\"`\n\tTargetCommitish string         `json:\"target_commitish\"`\n\tBody            string         `json:\"body\"`\n\tDraft           bool           `json:\"draft\"`\n\tPrerelease      bool           `json:\"prerelease\"`\n\tAssets          []ReleaseAsset `json:\"assets\"`\n\tTarballUrl      string         `json:\"tarball_url\"`\n\tZipballUrl      string         `json:\"zipball_url\"`\n\tHtmlUrl         string         `json:\"html_url\"`\n\tUploadUrl       string         `json:\"upload_url\"`\n\tApiUrl          string         `json:\"url\"`\n\tCreatedAt       time.Time      `json:\"created_at\"`\n\tPublishedAt     time.Time      `json:\"published_at\"`\n}\n```\n\n```go\ntype ReleaseAsset struct {\n\tName        string `json:\"name\"`\n\tLabel       string `json:\"label\"`\n\tDownloadUrl string `json:\"browser_download_url\"`\n\tApiUrl      string `json:\"url\"`\n}\n```\n\n```go\ntype Remote struct {\n\tName    string\n\tURL     *url.URL\n\tPushURL *url.URL\n}\n```\n\n```go\nfunc Remotes() (remotes []Remote, err error)\n```\n\n```go\nfunc (remote *Remote) Project() (*Project, error)\n```\n\n```go\nfunc (remote *Remote) String() string\n```\n\n```go\ntype Repository struct {\n\tName          string                 `json:\"name\"`\n\tFullName      string                 `json:\"full_name\"`\n\tParent        *Repository            `json:\"parent\"`\n\tOwner         *User                  `json:\"owner\"`\n\tPrivate       bool                   `json:\"private\"`\n\tHasWiki       bool                   `json:\"has_wiki\"`\n\tPermissions   *RepositoryPermissions `json:\"permissions\"`\n\tHtmlUrl       string                 `json:\"html_url\"`\n\tDefaultBranch string                 `json:\"default_branch\"`\n}\n```\n\n```go\ntype RepositoryPermissions struct {\n\tAdmin bool `json:\"admin\"`\n\tPush  bool `json:\"push\"`\n\tPull  bool `json:\"pull\"`\n}\n```\n\n```go\ntype Team struct {\n\tName string `json:\"name\"`\n\tSlug string `json:\"slug\"`\n}\n```\n\n```go\ntype URL struct {\n\turl.URL\n\t*Project\n}\n```\n\n```go\nfunc ParseURL(rawurl string) (*URL, error)\n```\n\n```go\nfunc (url URL) ProjectPath() (projectPath string)\n```\n\n```go\ntype User struct {\n\tLogin string `json:\"login\"`\n}\n```\n\n","path":"github.com/Github/hub/github","name":"github","synopsis":"","isRedistributable":true}
