Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStale ¶
func IsStale(ctx context.Context, repo *git.Repository, ref *plumbing.Reference, age time.Duration, auth transport.AuthMethod, log *slog.Logger) bool
IsStale is a helper that wraps checkStaleness and handles logging. Returns true if the branch is definitely stale and should be skipped. Returns false if it's fresh OR if we couldn't determine (fail-safe).
func PruneItems ¶
func PruneItems[T any]( items []T, dryRun bool, log *slog.Logger, dryRunMsg string, prunedMsg string, errorMsg string, getName func(T) string, deleteFunc func(T) error, ) []string
PruneItems is a generic helper for pruning items (branches, tags, directories). It iterates over a list of obsolete items, checks for dry-run, logs actions, and executes the deletion logic.
func SanitizeName ¶
SanitizeName converts a Git ref name into a valid Puppet environment name. Puppet environments only allow [a-zA-Z0-9_]. Any character outside this set is replaced with an underscore.
Types ¶
type Result ¶
type Result struct {
RepoName string
BranchesSynced []string
BranchesUpToDate []string
BranchesFailed []string
TagsFetched []string
TagsUpToDate []string
TagsFailed []string
TagsObsolete []string
TagsPruned []string
BranchesObsolete []string
BranchesPruned []string
BranchesStale []string
Checkout string
Err error
}
Result holds the outcome of syncing a single repository.
type SyncOptions ¶
SyncOptions controls optional sync behaviour.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer performs git sync operations.
func (*Syncer) SyncRepo ¶
func (s *Syncer) SyncRepo(ctx context.Context, repo *config.RepoConfig, opts SyncOptions) Result
SyncRepo syncs a single repository.