{"modulePath":"github.com/pschultz/hub","version":"v2.2.9+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Constants\n\n```go\nconst (\n\tGitHubHost    string = \"github.com\"\n\tGitHubApiHost string = \"api.github.com\"\n\tOAuthAppURL   string = \"http://hub.github.com/\"\n)\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 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 SanitizeProjectName(name string) string\n```\n\n## Types\n\n```go\ntype AuthError struct {\n\tErr error\n}\n```\n\n```go\nfunc (e *AuthError) Error() string\n```\n\n```go\nfunc (e *AuthError) IsDuplicatedTokenError() bool\n```\n\n```go\nfunc (e *AuthError) IsRequired2FACodeError() bool\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 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, title, body string, labels []string) (issue *octokit.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, params octokit.ReleaseParams) (release *octokit.Release, err error)\n```\n\n```go\nfunc (client *Client) CreateRepository(project *Project, description, homepage string, isPrivate bool) (repo *octokit.Repository, err error)\n```\n\n```go\nfunc (client *Client) CurrentUser() (user *octokit.User, 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) FindOrCreateToken(user, password, twoFactorCode string) (token string, err error)\n```\n\n```go\nfunc (client *Client) ForkRepository(project *Project) (repo *Repository, err error)\n```\n\n```go\nfunc (client *Client) GhLatestTagName() (tagName string, err error)\n```\n\n```go\nfunc (client *Client) GistPatch(id string) (patch io.ReadCloser, err error)\n```\n\n```go\nfunc (client *Client) IsRepositoryExist(project *Project) bool\n```\n\n```go\nfunc (client *Client) Issues(project *Project) (issues []octokit.Issue, err error)\n```\n\n```go\nfunc (client *Client) PullRequest(project *Project, id string) (pr *octokit.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) Release(project *Project, tagName string) (release *octokit.Release, err error)\n```\n\n```go\nfunc (client *Client) Releases(project *Project) (releases []octokit.Release, err error)\n```\n\n```go\nfunc (client *Client) Repository(project *Project) (repo *octokit.Repository, err error)\n```\n\n```go\nfunc (client *Client) UploadReleaseAsset(uploadUrl *url.URL, asset *os.File, contentType string) (err error)\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) 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(filePrefix, topic, message string) (editor *Editor, err error)\n```\n\n```go\nfunc (e *Editor) DeleteFile() error\n```\n\n```go\nfunc (e *Editor) EditTitleAndBody() (title, body string, err error)\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) MainProject() (project *Project, err error)\n```\n\n```go\nfunc (r *GitHubRepo) MainRemote() (remote *Remote, err error)\n```\n\n```go\nfunc (r *GitHubRepo) MasterBranch() (branch *Branch)\n```\n\n```go\nfunc (r *GitHubRepo) OriginRemote() (remote *Remote, err error)\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) 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}\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 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 struct {\n\tHTMLURL string `json:\"html_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\tParent *Repository      `json:\"parent\"`\n\tOwner  *RepositoryOwner `json:\"owner\"`\n}\n```\n\n```go\ntype RepositoryOwner struct {\n\tLogin string `json:\"login\"`\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","path":"github.com/pschultz/hub/github","name":"github","synopsis":"","isRedistributable":true}
