Documentation ¶
Index ¶
- Variables
- func CollectPackages(path string, depth int) ([]pack.Package, error)
- func ExecCommand(cwd string, command string, args ...string) ([]byte, error)
- func ReadConfig(requestedPath string, overrides ...config.YAMLOption) (config.Provider, error)
- func Run(pkgs []pack.Package, actions []Action, resultHandler ResultHandler, ...)
- type Action
- type ActionResult
- type ActionStatus
- type BaseActionResult
- type BumpAction
- type CheckAction
- type CommandRunner
- type CommitAction
- type FinishedHandler
- type MakeAction
- type PushAction
- type ResultHandler
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 ¶
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 ReadConfig ¶
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 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)
Click to show internal directories.
Click to hide internal directories.