runner

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommandRunner added in v0.10.0

func NewCommandRunner(filter *Filter, sh shell.Shell, handler RepoHandler) func(
	cmd *cobra.Command,
	args []string,
) error

func NewCommandRunnerForExistingRepos added in v0.10.0

func NewCommandRunnerForExistingRepos(filter *Filter, sh shell.Shell, handler RepoHandler) func(
	cmd *cobra.Command,
	args []string,
) error

func ParseNegated added in v0.7.0

func ParseNegated(value string) (bool, string)

ParseNegated gets a string value and analyzes if it is negated or not - effectively, if it starts with a prefix or not.

It returns a bool flag and a clean value, without the prefix even for negated value

Types

type Filter

type Filter struct {
	Names  []string
	Tags   []string
	Groups []string
}

func (*Filter) AddCommandFlags

func (f *Filter) AddCommandFlags(command *cobra.Command)

func (*Filter) FilterMatchingRepos added in v0.3.0

func (f *Filter) FilterMatchingRepos(repos []settings.Repo, groups []settings.Group) []settings.Repo

func (*Filter) MatchesRepo added in v0.3.0

func (f *Filter) MatchesRepo(repo settings.Repo, groups []settings.Group) bool

type ParallelRunner added in v0.1.1

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

func (*ParallelRunner) Run added in v0.1.1

func (r *ParallelRunner) Run(
	ctx context.Context, repos []settings.Repo, handler RepoHandler,
) (map[string]ProcessResult, error)

type ProcessResult

type ProcessResult struct {
	Result interface{}
	Error  error
}

type Progress added in v0.3.0

type Progress interface {
	// IncrProgress increase current progress with 1
	IncrProgress()
	// IncrErrors increments number of errors happened during the process
	IncrErrors()
	// IndicateTermination makes progress indicate that bulker received "SIGINT" and terminates gracefully
	IndicateTermination()
}

func NewProgress added in v0.3.0

func NewProgress(conf *config.Config, maxCount int) Progress

type ProgressBarProgress added in v0.3.0

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

func (*ProgressBarProgress) IncrErrors added in v0.10.0

func (p *ProgressBarProgress) IncrErrors()

func (*ProgressBarProgress) IncrProgress added in v0.10.0

func (p *ProgressBarProgress) IncrProgress()

func (*ProgressBarProgress) IndicateTermination added in v0.7.0

func (p *ProgressBarProgress) IndicateTermination()

type RepoHandler

type RepoHandler func(ctx context.Context, runContext *RunContext) (interface{}, error)

type RunContext

type RunContext struct {
	Manager *settings.Manager
	Config  *config.Config
	Repo    *model.Repo
	Args    []string
}

type Runner

type Runner interface {
	Run(ctx context.Context, repos []settings.Repo, handler RepoHandler) (map[string]ProcessResult, error)
}

func NewRunner

func NewRunner(conf *config.Config, sh shell.Shell, filter *Filter, progress Progress, args []string) (Runner, error)

type SequentialRunner added in v0.1.1

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

func (*SequentialRunner) Run added in v0.1.1

func (r *SequentialRunner) Run(
	ctx context.Context, repos []settings.Repo, handler RepoHandler,
) (map[string]ProcessResult, error)

Jump to

Keyboard shortcuts

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