Documentation
¶
Index ¶
- Constants
- Variables
- func GetImpersonationToken(ctx context.Context, flags *PushFlags) (string, error)
- func Pull(ctx context.Context, flags *PullFlags) error
- func PullManyWithGitImpl(ctx context.Context, sourceURL, cacheDir string, repoNames []string, ...) error
- func PullWithGitImpl(ctx context.Context, sourceURL, cacheDir string, repoName string, ...) error
- func Push(ctx context.Context, flags *PushFlags) error
- func PushManyWithGitImpl(ctx context.Context, flags *PushFlags, repoNames []string, ...) error
- func PushWithGitImpl(ctx context.Context, flags *PushFlags, repoName string, ...) error
- func Sync(ctx context.Context, flags *SyncFlags) error
- type CommonFlags
- type GitImplementation
- type GitRemote
- type GitRepository
- type PullFlags
- type PullOnlyFlags
- type PushFlags
- type PushOnlyFlags
- type SyncFlags
- type Validations
Constants ¶
View Source
const DefaultBatchSize = 0
DefaultBatchSize of 0 means no batching (push all refs at once, original behavior)
View Source
const MinBatchSize = 10
MinBatchSize is the minimum allowed batch size when batching is enabled
Variables ¶
View Source
var ( NwoRegExp = regexp.MustCompile(`^[^/\s]+/[^/\s]+$`) ErrEmptyRepoList = errors.New("repo list cannot be empty") ErrEmptyCacheDir = errors.New("cache directory contains no actions to sync") )
Functions ¶
func GetImpersonationToken ¶
func PullManyWithGitImpl ¶
func PullWithGitImpl ¶
func PushManyWithGitImpl ¶
func PushWithGitImpl ¶
Types ¶
type CommonFlags ¶
type CommonFlags struct {
CacheDir, RepoName, RepoNameList, RepoNameListFile string
}
flags common to pull, push and sync operations
func (*CommonFlags) HasAtLeastOneRepoFlag ¶
func (f *CommonFlags) HasAtLeastOneRepoFlag() bool
func (*CommonFlags) Init ¶
func (f *CommonFlags) Init(cmd *cobra.Command)
func (*CommonFlags) Validate ¶
func (f *CommonFlags) Validate(reposRequired bool) Validations
type GitImplementation ¶
type GitImplementation interface {
NewGitRepository(dir string) (GitRepository, error)
CloneRepository(dir string, o *git.CloneOptions) (GitRepository, error)
RepositoryExists(dir string) bool
}
type GitRemote ¶
type GitRemote interface {
PushContext(context.Context, *git.PushOptions) error
Config() *config.RemoteConfig
}
type GitRepository ¶
type GitRepository interface {
DeleteRemote(string) error
CreateRemote(*config.RemoteConfig) (GitRemote, error)
FetchContext(context.Context, *git.FetchOptions) error
References() (storer.ReferenceIter, error)
}
type PullFlags ¶
type PullFlags struct {
CommonFlags
PullOnlyFlags
}
func (*PullFlags) Validate ¶
func (f *PullFlags) Validate() Validations
type PullOnlyFlags ¶
type PullOnlyFlags struct {
SourceURL string
}
func (*PullOnlyFlags) Init ¶
func (f *PullOnlyFlags) Init(cmd *cobra.Command)
func (*PullOnlyFlags) Validate ¶
func (f *PullOnlyFlags) Validate() Validations
type PushFlags ¶
type PushFlags struct {
CommonFlags
PushOnlyFlags
}
func (*PushFlags) Validate ¶
func (f *PushFlags) Validate() Validations
type PushOnlyFlags ¶
type PushOnlyFlags struct {
BaseURL, Token, ActionsAdminUser string
DisableGitAuth bool
BatchSize int
}
func (*PushOnlyFlags) Init ¶
func (f *PushOnlyFlags) Init(cmd *cobra.Command)
func (*PushOnlyFlags) Validate ¶
func (f *PushOnlyFlags) Validate() Validations
type SyncFlags ¶
type SyncFlags struct {
CommonFlags
PullOnlyFlags
PushOnlyFlags
}
func (*SyncFlags) Validate ¶
func (f *SyncFlags) Validate() Validations
type Validations ¶
type Validations []string
func (Validations) Error ¶
func (v Validations) Error() error
func (Validations) Join ¶
func (v Validations) Join(o Validations) Validations
Click to show internal directories.
Click to hide internal directories.