Back to godoc.org

Package pr

v0.6.0
Latest Go to latest

The latest major version is .

Published: Oct 8, 2017 | License: MIT | Module: github.com/abhinav/git-fu

Index

func UpdateMessage

func UpdateMessage(ed editor.Editor, pr *github.PullRequest) error

UpdateMessage uses the given editor to edit the commit message of the given PR.

func Walk

func Walk(cfg WalkConfig, pulls []*github.PullRequest, v Visitor) error

Walk traverses a pull request tree by visiting the given pull requests and their children in an unspecified order. The only ordering guarantee is that parents are visited before their children.

Errors encountered while visiting pull requests are collatted and presented as one.

type Service

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

Service is a PR service.

func NewService

func NewService(cfg ServiceConfig) *Service

NewService builds a new PR service with the given configuration.

func (*Service) Land

func (s *Service) Land(ctx context.Context, req *service.LandRequest) (*service.LandResponse, error)

Land the given pull request.

func (*Service) Rebase

func (s *Service) Rebase(ctx context.Context, req *service.RebaseRequest) (_ *service.RebaseResponse, err error)

Rebase a pull request and its dependencies.

type ServiceConfig

type ServiceConfig struct {
	GitHub gateway.GitHub
	Git    gateway.Git
}

ServiceConfig specifies the different parameters for a PR service.

type Visitor

type Visitor interface {
	// Visits the given pull request and returns a new visitor to visit its
	// children.
	//
	// If a visitor was not returned, the children of this PR will not be
	// visited.
	//
	// This function MAY be called concurrently. Implementations MUST be
	// thread-safe.
	Visit(*github.PullRequest) (Visitor, error)
}

Visitor defines what to do at each pull request during a walk.

type WalkConfig

type WalkConfig struct {
	// Maximum number of pull requests to visit at the same time.
	//
	// Defaults to the number of CPUs available to this process.
	Concurrency int

	// Children retrieves the children of the given pull request.
	//
	// The definition of what constitutes a child of a PR is left up to the
	// implementation.
	//
	// This function MAY be called concurrently. Implementations MUST be
	// thread-safe.
	Children func(*github.PullRequest) ([]*github.PullRequest, error)
}

WalkConfig configures a pull request traversal.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier