gateway

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchRequest

type FetchRequest struct {
	Remote    string // name of the remote
	RemoteRef string // ref to fetch
	LocalRef  string // name of the ref locally
}

FetchRequest is a request to fetch a branch.

type Git

type Git interface {
	// Determines the name of the current branch.
	CurrentBranch() (string, error)

	// Determines if a local branch with the given name exists.
	DoesBranchExist(name string) bool

	// Deletes the given branch.
	DeleteBranch(name string) error

	// Deletes the remote tracking branch with the given name.
	DeleteRemoteTrackingBranch(remote, name string) error

	// Create a branch with the given name and head but don't switch to it.
	CreateBranch(name, head string) error

	// Creates and switches to a local branch with the given name at the given
	// ref.
	CreateBranchAndSwitch(name, head string) error

	// Switches branches.
	Checkout(name string) error

	// Fetch a ref
	Fetch(*FetchRequest) error

	// Push a branch
	Push(*PushRequest) error

	// Push many branches
	PushMany(*PushManyRequest) error

	// Rebase a branch
	Rebase(*RebaseRequest) error

	// Reset the given branch to the given head.
	ResetBranch(branch, head string) error

	// Get the SHA1 hash for the given ref.
	SHA1(ref string) (string, error)

	// Pulls a branch from a specific remote.
	Pull(remote, name string) error

	// Applies the given patch using git-am.
	ApplyPatches(patches string) error

	// RemoteURL gets the URL for the given remote.
	RemoteURL(name string) (string, error)
}

Git is a gateway to access git locally.

type GitHub

type GitHub interface {
	// Checks if the given pull request branch is owned by the same
	// repository.
	IsOwned(br *github.PullRequestBranch) bool

	// List pull requests on this repository with the given head. If owner is
	// empty, the current repository should be used.
	ListPullRequestsByHead(owner, branch string) ([]*github.PullRequest, error)

	// List pull requests on this repository with the given merge base.
	ListPullRequestsByBase(branch string) ([]*github.PullRequest, error)

	// Retrieve the raw patch for the given pull request.
	GetPullRequestPatch(number int) (string, error)

	// Change the merge base for the given pull request.
	SetPullRequestBase(number int, base string) error

	// Merges the given pull request.
	SquashPullRequest(*github.PullRequest) error

	// Delete the given branch.
	DeleteBranch(name string) error
}

GitHub is a gateway that provides access to GitHub operations on a specific repository.

type PushManyRequest added in v0.2.2

type PushManyRequest struct {
	Remote string
	// Mapping of local ref to remote ref. Remote ref may be empty to indicate
	// that the local ref name should be used.
	Refs  map[string]string
	Force bool
}

PushManyRequest is a request to push many refs in one go.

type PushRequest

type PushRequest struct {
	Remote    string
	LocalRef  string
	RemoteRef string
	Force     bool
}

PushRequest is a request to push a branch.

type RebaseRequest added in v0.2.1

type RebaseRequest struct {
	Onto   string // --onto
	From   string // if provided, we diff against this ref
	Branch string // branch to rebase
}

RebaseRequest is a request to perform a Git rebase.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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