ghforeach

package
v0.0.0-...-28008a6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run() error

func RunWithArgs

func RunWithArgs(args *Args) error

Types

type Args

type Args struct {
	Command string `arg:"positional" help:"command to run at root of each repo."`

	// authentication
	AuthUser  *string `arg:"env:GH_AUTH_USER" help:"user for authenticating API requests."`
	AuthToken *string `arg:"env:GH_AUTH_TOKEN" help:"token for authenticating API requests."`

	// repo owner options
	Org  *string `arg:"-o" help:"organization owning repositories to be iterated."`
	User *string `arg:"-u" help:"user owning repositories to be iterated."`

	// filtering parameters
	NameExp   *string `arg:"-n" help:"regular expression for matching repository names."`
	NameList  *string `arg:"-N" help:"path to file containing repository names (newline separated)."`
	TopicExp  *string `arg:"-t" help:"regular expression for matching topics."`
	TopicList *string `arg:"-T" help:"path to file containing topics (newline separated)."`

	// execution parameters
	Shell     string `arg:"-s" default:"/bin/sh" help:"path to shell used to run command."`
	TmpDir    string `arg:"-d" default:"./tmp" help:"directory into which repositories will be cloned."`
	Cleanup   bool   `arg:"-c" help:"enable to delete TMPDIR after operations are complete."`
	Overwrite bool   `arg:"-O" help:"enable to delete TMPDIR before operations start."`
	NThreads  int    `arg:"-p" default:"1" help:"number of repositories that will be handled in parallel. -1 for unlimited."`
	Json      bool   `arg:"-j" help:"enable to display output as JSON."`
	Debug     bool   `arg:"-D" help:"enable to debug logging."`
}

type RepositoryExecutor

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

func NewRepositoryExecutor

func NewRepositoryExecutor(opts ...RepositoryExecutorOption) (*RepositoryExecutor, error)

func (*RepositoryExecutor) Go

func (rh *RepositoryExecutor) Go(ctx context.Context, command string) error

type RepositoryExecutorOption

type RepositoryExecutorOption = func(*RepositoryExecutor) error

func WithCleanup

func WithCleanup(b bool) RepositoryExecutorOption

func WithClient

func WithClient(client *github.Client) RepositoryExecutorOption

func WithConcurrency

func WithConcurrency(n int) RepositoryExecutorOption

func WithLogger

func WithLogger(logger *zap.Logger) RepositoryExecutorOption

func WithNameList

func WithNameList(names []string) RepositoryExecutorOption

func WithNameRegexp

func WithNameRegexp(exp string) RepositoryExecutorOption

func WithOrg

func WithOrg(org string) RepositoryExecutorOption

func WithOverwrite

func WithOverwrite(b bool) RepositoryExecutorOption

func WithShellPath

func WithShellPath(path string) RepositoryExecutorOption

func WithTmpDir

func WithTmpDir(dir string) RepositoryExecutorOption

func WithTopicList

func WithTopicList(topics []string) RepositoryExecutorOption

func WithTopicRegexp

func WithTopicRegexp(exp string) RepositoryExecutorOption

func WithUser

func WithUser(user string) RepositoryExecutorOption

func WithUserAuth

func WithUserAuth(user, token string) RepositoryExecutorOption

type RepositoryExecutorOutputFormat

type RepositoryExecutorOutputFormat = int
const (
	ConsoleOutputFormat RepositoryExecutorOutputFormat = iota
	JsonOutputFormat
)

Jump to

Keyboard shortcuts

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