bumper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConfigPath = errors.New("invalid configuration path")
	ErrUnknownConfigPath = errors.New("could not determine config file path")
)
View Source
var (
	ErrBumpAction = errors.New("bump action error")
)
View Source
var ErrCheckAction = errors.New("check action error")
View Source
var ErrCommitAction = errors.New("commit action error")
View Source
var ErrMakeAction = errors.New("make action error")
View Source
var (
	ErrPushAction = errors.New("push action error")
)

Functions

func CollectPackages

func CollectPackages(path string, depth int) ([]pack.Package, error)

CollectPackages recursively finds AUR packages in the given directory, up to a given depth. Depth 0 means only given directory is searched. Depth 1 checks subdirectories as well, etc...

func ExecCommand

func ExecCommand(cwd string, command string, args ...string) ([]byte, error)

func ReadConfig

func ReadConfig(requestedPath string, overrides ...config.YAMLOption) (config.Provider, error)

ReadConfig reads config at the given path, or at the default location if the path is empty.

func Run

func Run(pkgs []pack.Package, actions []Action, resultHandler ResultHandler, finishedHandler FinishedHandler)

Run runs actions for the packages, blocks until all results are handled. For each result, and on finished processing, appropriate handlers are called. Actions and handlers for a single package are run sequentially, but the packages are handled concurrently.

Types

type Action

type Action interface {
	Execute(pack *pack.Package) ActionResult
}

type ActionResult

type ActionResult interface {
	GetStatus() ActionStatus
	GetError() error
	String() string
}

type ActionStatus

type ActionStatus int
const (
	ActionSuccessStatus ActionStatus = iota
	ActionSkippedStatus
	ActionFailedStatus
)

type BaseActionResult

type BaseActionResult struct {
	Status ActionStatus
	Error  error
}

func (*BaseActionResult) GetError

func (result *BaseActionResult) GetError() error

func (*BaseActionResult) GetStatus

func (result *BaseActionResult) GetStatus() ActionStatus

type BumpAction

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

func NewBumpAction

func NewBumpAction(commandRunner CommandRunner) *BumpAction

func (*BumpAction) Execute

func (action *BumpAction) Execute(pkg *pack.Package) ActionResult

type CheckAction

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

func NewCheckAction

func NewCheckAction(versionProviderFactory versionProviderFactory, checkConfig config.Value) *CheckAction

func (*CheckAction) Execute

func (action *CheckAction) Execute(pkg *pack.Package) ActionResult

type CommandRunner

type CommandRunner = func(cwd string, command string, args ...string) ([]byte, error)

type CommitAction

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

func NewCommitAction

func NewCommitAction(commandRunner CommandRunner, commitConfig config.Value) *CommitAction

func (*CommitAction) Execute

func (action *CommitAction) Execute(pkg *pack.Package) ActionResult

type FinishedHandler

type FinishedHandler func(pkgIndex int)

type MakeAction

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

func NewMakeAction

func NewMakeAction(commandRunner CommandRunner) *MakeAction

func (*MakeAction) Execute

func (action *MakeAction) Execute(pkg *pack.Package) ActionResult

type PushAction

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

func NewPushAction

func NewPushAction(commandRunner CommandRunner) *PushAction

func (*PushAction) Execute

func (action *PushAction) Execute(pkg *pack.Package) ActionResult

type ResultHandler

type ResultHandler func(pkgIndex int, result ActionResult)

Jump to

Keyboard shortcuts

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