providers

package
v0.0.0-...-b9e087e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingWithFlag   = fmt.Errorf("missing --with flag to replace with")
	ErrMissingRegexpFlag = fmt.Errorf("missing --regexp flag to find what to replace")
)
View Source
var ErrNoProviderFound = fmt.Errorf("no provider found")

Functions

This section is empty.

Types

type Bitbucket

type Bitbucket struct {
	DefaultProvider
	BitbucketURL string
}

func NewBitbucket

func NewBitbucket(dir, url string) *Bitbucket

func (*Bitbucket) Clone

func (b *Bitbucket) Clone(whitelist []string, hasFile, contentRegexp string) error

func (*Bitbucket) PR

func (b *Bitbucket) PR(repos []string, prMode string) error

PR opens PR for each repo in repos list. If list is zero it opens for each repo in the --dir path.

type DefaultProvider

type DefaultProvider struct {
	Dir              string
	RepoURLWhitelist []string
}

func (*DefaultProvider) Clone

func (d *DefaultProvider) Clone(whitelist []string, hasFile, contentRegex string) error

func (*DefaultProvider) CommandEachMatchingFile

func (d *DefaultProvider) CommandEachMatchingFile(command, fileRegex, pathRegex string, contentRegex []string) error

func (*DefaultProvider) Git

func (d *DefaultProvider) Git(gitArgs []string) error

func (*DefaultProvider) PR

func (d *DefaultProvider) PR(repos []string, prMode string) error

func (*DefaultProvider) Replace

func (d *DefaultProvider) Replace(regex, with, fileRegex, pathRegex string, contentRegex []string) error

func (*DefaultProvider) ShouldProcessRepo

func (d *DefaultProvider) ShouldProcessRepo(path string) (bool, error)

func (*DefaultProvider) WorkDir

func (d *DefaultProvider) WorkDir() string

type Provider

type Provider interface {
	Clone(whitelist []string, hasFile, contentRegex string) error
	Git(args []string) error
	PR(repos []string, prMode string) error
	Replace(regexp, with, fileRegexp, pathRegex string, contentRegex []string) error
	ShouldProcessRepo(path string) (bool, error)
	WorkDir() string
	CommandEachMatchingFile(command, fileRegex, pathRegex string, contentRegex []string) error
}

func GetProvider

func GetProvider(c *cli.Context) (Provider, error)

Jump to

Keyboard shortcuts

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