github

package
v0.0.0-...-27fdd0b Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2013 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	DefaultConfigFile = filepath.Join(os.Getenv("HOME"), ".config", "gh")
)

Functions

func MatchURL

func MatchURL(url string) []string

func SaveConfig

func SaveConfig(config *Config) error

Types

type Config

type Config struct {
	User  string `json:"user"`
	Token string `json:"token"`
}

func CurrentConfig

func CurrentConfig() *Config

func (*Config) FetchCredentials

func (c *Config) FetchCredentials()

func (*Config) FetchPassword

func (c *Config) FetchPassword() string

func (*Config) FetchUser

func (c *Config) FetchUser() string

type GitHub

type GitHub struct {
	Project *Project
	Config  *Config
}

func New

func New() *GitHub

func NewWithoutProject

func NewWithoutProject() *GitHub

TODO: detach project from GitHub

func (*GitHub) CiStatus

func (gh *GitHub) CiStatus(sha string) (*octokat.Status, error)

func (*GitHub) CreatePullRequest

func (gh *GitHub) CreatePullRequest(base, head, title, body string) (string, error)

func (*GitHub) CreatePullRequestForIssue

func (gh *GitHub) CreatePullRequestForIssue(base, head, issue string) (string, error)

func (*GitHub) CreateRepository

func (gh *GitHub) CreateRepository(project Project, description, homepage string, isPrivate bool) (*octokat.Repository, error)

func (*GitHub) ExpandRemoteUrl

func (gh *GitHub) ExpandRemoteUrl(owner, name string, isSSH bool) (url string)

func (*GitHub) ForkRepository

func (gh *GitHub) ForkRepository(name, owner string, noRemote bool) (repo *octokat.Repository, err error)

func (*GitHub) IsRepositoryExist

func (gh *GitHub) IsRepositoryExist(project Project) bool

TODO: detach GitHub from Project

func (*GitHub) PullRequest

func (gh *GitHub) PullRequest(id string) (*octokat.PullRequest, error)

func (*GitHub) Repository

func (gh *GitHub) Repository(project Project) (*octokat.Repository, error)

type Project

type Project struct {
	Name  string
	Owner string
}

func CurrentProject

func CurrentProject() *Project

func NewProjectFromNameAndOwner

func NewProjectFromNameAndOwner(name, owner string) Project

func ParseProjectFromURL

func ParseProjectFromURL(uu string) (*Project, error)

func (*Project) GitURL

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

func (*Project) LocalRepo

func (p *Project) LocalRepo() *Repo

func (*Project) LocalRepoWith

func (p *Project) LocalRepoWith(base, head string) *Repo

func (Project) String

func (p Project) String() string

func (*Project) WebURL

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

type Repo

type Repo struct {
	Base    string
	Head    string
	Project *Project
}

func (*Repo) FullBase

func (r *Repo) FullBase() string

func (*Repo) FullHead

func (r *Repo) FullHead() string

Jump to

Keyboard shortcuts

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