controller

package
v0.1.0-2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Git    Git
	GitHub GitHub
	Expr   Expr
	Config config.Config
}

func (Controller) UpdatePR

func (ctrl Controller) UpdatePR(ctx context.Context) error

type Expr

type Expr interface {
	Match(params interface{}) (bool, error)
}

type Git

type Git interface {
	Fetch(ctx context.Context, remote, branch string) error
	Checkout(ctx context.Context, branch string) error
	CommitEmpty(ctx context.Context, msg string) error
	Push(ctx context.Context, branch string) error
	PushForce(ctx context.Context, branch string) error
	Reset(ctx context.Context) error
}

type GitHub

type GitHub interface {
	ListPRs(ctx context.Context, params gh.ParamsListPRs) ([]*github.PullRequest, *github.Response, error)
	GetRef(ctx context.Context, params gh.ParamsGetRef) (*github.Reference, *github.Response, error)
	GetCommit(ctx context.Context, params gh.ParamsGetCommit) (*github.Commit, *github.Response, error)
	CreateEmptyCommit(ctx context.Context, params gh.ParamsCreateEmptyCommit) (*github.Commit, *github.Response, error)
	UpdateRef(ctx context.Context, params gh.ParamsUpdateRef) (*github.Reference, *github.Response, error)
}

type ParamsUpdatePR

type ParamsUpdatePR struct {
	Branch         string
	EmptyCommitMsg string
	Logger         *logrus.Entry
}

Jump to

Keyboard shortcuts

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