Documentation
¶
Index ¶
- Constants
- Variables
- func Execute(version string)
- func NewSyncReposWorkerPool(ctx context.Context, clone, update, archive bool, ...) *syncReposWorkerPool
- type FilePath
- type GithubRepoProvider
- func (gh GithubRepoProvider) GetRepo(ctx context.Context, repoUrl string) (RemoteRepo, error)
- func (p GithubRepoProvider) IsMatch(s string) bool
- func (gh GithubRepoProvider) ListRepos(ctx context.Context, org string, includeArchived bool, ...) error
- func (gh GithubRepoProvider) ListReposByOrg(ctx context.Context, org string, includeArchived bool, ...) error
- func (gh GithubRepoProvider) ListReposByUser(ctx context.Context, org string, includeArchived bool, ...) error
- func (p GithubRepoProvider) NormaliseGitUrl(s string) string
- type GitlabRepoProvider
- func (gl GitlabRepoProvider) GetRepo(ctx context.Context, repoName string) (RemoteRepo, error)
- func (p GitlabRepoProvider) IsMatch(s string) bool
- func (gl GitlabRepoProvider) ListRepos(ctx context.Context, org string, includeArchived bool, ...) error
- func (gl GitlabRepoProvider) ListReposByOrg(ctx context.Context, client *gitlab.Client, org string, includeArchived bool, ...) error
- func (gl GitlabRepoProvider) ListReposByUser(ctx context.Context, client *gitlab.Client, user string, includeArchived bool, ...) error
- func (p GitlabRepoProvider) NormaliseGitUrl(s string) string
- type ProgressLogger
- func (p *ProgressLogger) AddTotalToProgress(n int32)
- func (p *ProgressLogger) EndProgressLine(doneMsg string)
- func (p *ProgressLogger) EventArchivedRepo(localDir string)
- func (p *ProgressLogger) EventClonedRepo(localDir string)
- func (p *ProgressLogger) EventExecCmd(cmd, dir string)
- func (p *ProgressLogger) EventIgnoredArchivedRepo(localDir string)
- func (p *ProgressLogger) EventIgnoredRepo(localDir string)
- func (p *ProgressLogger) EventSkippedRepo(localDir string)
- func (p *ProgressLogger) EventSyncedRepoError(localDir string)
- func (p *ProgressLogger) EventUpdatedRepo(localDir string)
- func (p *ProgressLogger) Info(s string)
- func (p *ProgressLogger) InfoWithSignalInteruptRaceDelay(ctx context.Context, s string)
- func (p *ProgressLogger) PrintProgressLine()
- type RemoteRepo
- type RepoName
- type RepoProvider
- type TidyAction
Constants ¶
View Source
const RemoteReposChannelSize = SyncWorkerPoolSize * 20 // buffer 20 repos per worker
View Source
const SyncWorkerPoolSize = 100
Variables ¶
View Source
var ErrRepoNotFound = errors.New("repo not found")
View Source
var KnownGitProviders = []RepoProvider{ NewGithubRepoProvider(), }
Functions ¶
func NewSyncReposWorkerPool ¶
func NewSyncReposWorkerPool(ctx context.Context, clone, update, archive bool, progressWriter *ProgressLogger) *syncReposWorkerPool
Types ¶
type GithubRepoProvider ¶
type GithubRepoProvider struct {
// contains filtered or unexported fields
}
func NewGithubRepoProvider ¶
func NewGithubRepoProvider() GithubRepoProvider
func (GithubRepoProvider) GetRepo ¶ added in v0.4.0
func (gh GithubRepoProvider) GetRepo(ctx context.Context, repoUrl string) (RemoteRepo, error)
func (GithubRepoProvider) ListRepos ¶
func (gh GithubRepoProvider) ListRepos(ctx context.Context, org string, includeArchived bool, remoteRepoChan chan RemoteRepo) error
func (GithubRepoProvider) ListReposByOrg ¶
func (gh GithubRepoProvider) ListReposByOrg(ctx context.Context, org string, includeArchived bool, remoteRepoChan chan RemoteRepo) error
func (GithubRepoProvider) ListReposByUser ¶
func (gh GithubRepoProvider) ListReposByUser(ctx context.Context, org string, includeArchived bool, remoteRepoChan chan RemoteRepo) error
func (GithubRepoProvider) NormaliseGitUrl ¶
type GitlabRepoProvider ¶
type GitlabRepoProvider struct {
// contains filtered or unexported fields
}
func NewGitlabRepoProvider ¶
func NewGitlabRepoProvider(host string) GitlabRepoProvider
func (GitlabRepoProvider) GetRepo ¶ added in v0.4.0
func (gl GitlabRepoProvider) GetRepo(ctx context.Context, repoName string) (RemoteRepo, error)
func (GitlabRepoProvider) ListRepos ¶
func (gl GitlabRepoProvider) ListRepos(ctx context.Context, org string, includeArchived bool, remoteRepoChan chan RemoteRepo) error
func (GitlabRepoProvider) ListReposByOrg ¶ added in v0.3.0
func (gl GitlabRepoProvider) ListReposByOrg(ctx context.Context, client *gitlab.Client, org string, includeArchived bool, remoteRepoChan chan RemoteRepo) error
func (GitlabRepoProvider) ListReposByUser ¶ added in v0.3.0
func (gl GitlabRepoProvider) ListReposByUser(ctx context.Context, client *gitlab.Client, user string, includeArchived bool, remoteRepoChan chan RemoteRepo) error
func (GitlabRepoProvider) NormaliseGitUrl ¶
type ProgressLogger ¶
type ProgressLogger struct { Printer *syncprinter.Printer WriterFor func(localDir string) io.Writer LogSyncedRepo bool LogExecCmd bool LogRealtimeProgress bool LogInfo bool // contains filtered or unexported fields }
func NewProgressLogger ¶
func NewProgressLogger(logLevel string) *ProgressLogger
func (*ProgressLogger) AddTotalToProgress ¶
func (p *ProgressLogger) AddTotalToProgress(n int32)
func (*ProgressLogger) EndProgressLine ¶
func (p *ProgressLogger) EndProgressLine(doneMsg string)
func (*ProgressLogger) EventArchivedRepo ¶
func (p *ProgressLogger) EventArchivedRepo(localDir string)
func (*ProgressLogger) EventClonedRepo ¶
func (p *ProgressLogger) EventClonedRepo(localDir string)
func (*ProgressLogger) EventExecCmd ¶
func (p *ProgressLogger) EventExecCmd(cmd, dir string)
func (*ProgressLogger) EventIgnoredArchivedRepo ¶
func (p *ProgressLogger) EventIgnoredArchivedRepo(localDir string)
func (*ProgressLogger) EventIgnoredRepo ¶
func (p *ProgressLogger) EventIgnoredRepo(localDir string)
func (*ProgressLogger) EventSkippedRepo ¶
func (p *ProgressLogger) EventSkippedRepo(localDir string)
func (*ProgressLogger) EventSyncedRepoError ¶
func (p *ProgressLogger) EventSyncedRepoError(localDir string)
func (*ProgressLogger) EventUpdatedRepo ¶
func (p *ProgressLogger) EventUpdatedRepo(localDir string)
func (*ProgressLogger) Info ¶
func (p *ProgressLogger) Info(s string)
func (*ProgressLogger) InfoWithSignalInteruptRaceDelay ¶ added in v0.3.0
func (p *ProgressLogger) InfoWithSignalInteruptRaceDelay(ctx context.Context, s string)
InfoWithSignalInteruptRaceDelay is a special case of Info that is used to print a message that might be interrupted by a signal interrupt. If the message is a signal interrupt message, it will delay the message by 1s to avoid prematurely spamming the terminal with multiple signal interrupt messages.
func (*ProgressLogger) PrintProgressLine ¶
func (p *ProgressLogger) PrintProgressLine()
type RemoteRepo ¶ added in v0.4.0
type RepoName ¶ added in v0.4.0
RepoName is the full name of a repository in the format "provider.tld/path"
func MustParseRepoName ¶ added in v0.4.0
func ParseRepoName ¶ added in v0.4.0
func (RepoName) LocalPathAbsolute ¶ added in v0.4.0
type RepoProvider ¶
type RepoProvider interface { IsMatch(s string) bool NormaliseGitUrl(s string) string ListRepos(ctx context.Context, org string, includeArchived bool, remoteRepoChan chan RemoteRepo) error GetRepo(ctx context.Context, repoName string) (RemoteRepo, error) }
func RepoProviderFor ¶
func RepoProviderFor(s string) (RepoProvider, error)
type TidyAction ¶ added in v0.4.0
type TidyAction struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.