github

package
v2.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2014 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHubHost    string = "github.com"
	GitHubApiHost string = "api.github.com"
	OAuthAppURL   string = "http://owenou.com/gh"
)

Variables

View Source
var (
	GitHubHostEnv = os.Getenv("GITHUB_HOST")
)

Functions

func CaptureCrash

func CaptureCrash()

func DefaultHost

func DefaultHost() string

func MatchURL added in v0.17.0

func MatchURL(url string) []string

Types

type Branch added in v0.26.0

type Branch struct {
	Name string
}

func (*Branch) IsRemote added in v0.26.0

func (b *Branch) IsRemote() bool

func (*Branch) LongName added in v0.26.0

func (b *Branch) LongName() string

func (*Branch) RemoteName added in v0.26.0

func (b *Branch) RemoteName() string

func (*Branch) ShortName added in v0.26.0

func (b *Branch) ShortName() string

func (*Branch) Upstream added in v0.26.0

func (b *Branch) Upstream() (u *Branch, err error)

type Client added in v0.26.0

type Client struct {
	Credentials *Credentials
}

func NewClient added in v0.26.0

func NewClient(host string) *Client

func (*Client) CIStatus added in v0.26.0

func (client *Client) CIStatus(project *Project, sha string) (status *octokit.Status, err error)

func (*Client) CreateIssue

func (client *Client) CreateIssue(project *Project, title, body string, labels []string) (issue *octokit.Issue, err error)

func (*Client) CreatePullRequest added in v0.26.0

func (client *Client) CreatePullRequest(project *Project, base, head, title, body string) (pr *octokit.PullRequest, err error)

func (*Client) CreatePullRequestForIssue added in v0.26.0

func (client *Client) CreatePullRequestForIssue(project *Project, base, head, issue string) (pr *octokit.PullRequest, err error)

func (*Client) CreateRelease

func (client *Client) CreateRelease(project *Project, params octokit.ReleaseParams) (release *octokit.Release, err error)

func (*Client) CreateRepository added in v0.26.0

func (client *Client) CreateRepository(project *Project, description, homepage string, isPrivate bool) (repo *octokit.Repository, err error)

func (*Client) FindOrCreateToken added in v0.26.0

func (client *Client) FindOrCreateToken(user, password, twoFactorCode string) (token string, err error)

func (*Client) ForkRepository added in v0.26.0

func (client *Client) ForkRepository(project *Project) (repo *octokit.Repository, err error)

func (*Client) GhLatestTagName

func (client *Client) GhLatestTagName() (tagName string, err error)

func (*Client) IsRepositoryExist added in v0.26.0

func (client *Client) IsRepositoryExist(project *Project) bool

func (*Client) Issues added in v0.26.0

func (client *Client) Issues(project *Project) (issues []octokit.Issue, err error)

func (*Client) PullRequest added in v0.26.0

func (client *Client) PullRequest(project *Project, id string) (pr *octokit.PullRequest, err error)

func (*Client) Releases added in v0.26.0

func (client *Client) Releases(project *Project) (releases []octokit.Release, err error)

func (*Client) Repository added in v0.26.0

func (client *Client) Repository(project *Project) (repo *octokit.Repository, err error)

func (*Client) UploadReleaseAsset

func (client *Client) UploadReleaseAsset(uploadUrl *url.URL, asset *os.File, contentType string) (err error)

type ClientError

type ClientError struct {
	// contains filtered or unexported fields
}

func (*ClientError) Error

func (e *ClientError) Error() string

func (*ClientError) Is2FAError

func (e *ClientError) Is2FAError() bool

type Configs added in v0.26.0

type Configs struct {
	Credentials []Credentials `json:"credentials"`
}

func CreateTestConfigs added in v0.26.0

func CreateTestConfigs(user, token string) *Configs

Public for testing purpose

func CurrentConfigs added in v0.26.0

func CurrentConfigs() *Configs

func (*Configs) DefaultCredentials added in v0.26.0

func (c *Configs) DefaultCredentials() (credentials *Credentials)

func (*Configs) PromptFor added in v0.26.0

func (c *Configs) PromptFor(host string) *Credentials

func (*Configs) PromptForOTP added in v0.26.0

func (c *Configs) PromptForOTP() string

func (*Configs) PromptForPassword added in v0.26.0

func (c *Configs) PromptForPassword(host, user string) (pass string)

func (*Configs) PromptForUser added in v0.26.0

func (c *Configs) PromptForUser() (user string)

func (*Configs) Save

func (c *Configs) Save() error

type Credentials added in v0.26.0

type Credentials struct {
	Host        string `json:"host"`
	User        string `json:"user"`
	AccessToken string `json:"access_token"`
}

type Editor

type Editor struct {
	Program string
	File    string
	Message string
	// contains filtered or unexported fields
}

func NewEditor

func NewEditor(topic, message string) (editor *Editor, err error)

func (*Editor) Edit

func (e *Editor) Edit() (content []byte, err error)

func (*Editor) EditTitleAndBody

func (e *Editor) EditTitleAndBody() (title, body string, err error)

type GitHubRepo added in v0.26.0

type GitHubRepo struct {
	// contains filtered or unexported fields
}

func LocalRepo added in v0.26.0

func LocalRepo() *GitHubRepo

func (*GitHubRepo) CurrentBranch added in v0.26.0

func (r *GitHubRepo) CurrentBranch() (branch *Branch, err error)

func (*GitHubRepo) CurrentProject added in v0.26.0

func (r *GitHubRepo) CurrentProject() (project *Project, err error)

func (*GitHubRepo) MainProject added in v0.26.0

func (r *GitHubRepo) MainProject() (project *Project, err error)

func (*GitHubRepo) MasterBranch added in v0.26.0

func (r *GitHubRepo) MasterBranch() (branch *Branch)

func (*GitHubRepo) RemoteBranchAndProject

func (r *GitHubRepo) RemoteBranchAndProject(owner string) (branch *Branch, project *Project, err error)

func (*GitHubRepo) RemoteByName

func (r *GitHubRepo) RemoteByName(name string) (*Remote, error)

func (*GitHubRepo) UpstreamProject added in v0.26.0

func (r *GitHubRepo) UpstreamProject() (project *Project, err error)

type Hosts added in v0.26.0

type Hosts []string

func (Hosts) Include added in v0.26.0

func (h Hosts) Include(host string) bool

type Project

type Project struct {
	Name  string
	Owner string
	Host  string
}

func NewProject added in v0.26.0

func NewProject(owner, name, host string) *Project

func NewProjectFromURL added in v0.18.0

func NewProjectFromURL(url *url.URL) (p *Project, err error)

func (*Project) GitURL

func (p *Project) GitURL(name, owner string, isSSH bool) (url string)

func (Project) String added in v0.14.0

func (p Project) String() string

func (*Project) WebURL

func (p *Project) WebURL(name, owner, path string) string

type Remote

type Remote struct {
	Name string
	URL  *url.URL
}

func OriginRemote

func OriginRemote() (*Remote, error)

func Remotes

func Remotes() (remotes []Remote, err error)

func (*Remote) Project

func (remote *Remote) Project() (*Project, error)

type URL added in v0.18.0

type URL struct {
	url.URL
	*Project
}

func ParseURL added in v0.18.0

func ParseURL(rawurl string) (*URL, error)

func (URL) ProjectPath added in v0.18.0

func (url URL) ProjectPath() (projectPath string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL