Versions in this module Expand all Collapse all v0 v0.12.0 Jul 19, 2026 Changes in this version + var ErrSyncQueueFull = errors.New("sync queue full") + var ErrSyncQueueShuttingDown = errors.New("sync queue shutting down") + func AllowRuleOwners(rules []RepoRule) []string + func AllowRulesSpanMultipleOwners(rules []RepoRule) (bool, []string) + func ExtractNamespace(repoFullName string) string + func IsNonRetryable(err error) bool + func NonRetryable(err error) error + func NormalizeBranchRef(ref string) (string, bool) + func ResolveCloneURL(repoFullName, payloadCloneURL string, baseURLs []string, allowPayload bool) (string, error) + func ValidateRepoNameNamespaceRules(rules []RepoRule) error + type BuildScope struct + ExcludePatterns []string + IncludePaths []string + type BuildScopeLoader interface + Load func(repoDir string) (BuildScope, error) + type CacheInvalidator interface + Invalidate func() + type CacheInvalidatorFunc func() + func (f CacheInvalidatorFunc) Invalidate() + type Checkout interface + Sync func(ctx context.Context, request CheckoutRequest) (repoDir string, err error) + type CheckoutRequest struct + Branch string + CloneURL string + Namespace string + RepoFullName string + type GraphRequest struct + ExcludePatterns []string + FailOnUnreadable bool + IncludePaths []string + MaxFileBytes int64 + MaxTotalParsedBytes int64 + Namespace string + RepoDir string + type GraphUpdater interface + Update func(ctx context.Context, request GraphRequest) (UpdateStats, error) + type Observability interface + LogArgs func(ctx context.Context) []any + Start func(ctx context.Context, operation, repo, branch string) (context.Context, func()) + type QueueConfig struct + MaxTrackedRepos int + Observability Observability + ShutdownTimeout time.Duration + type RepoFilter struct + func NewRepoFilter(patterns []string) *RepoFilter + func NewRepoFilterFromRules(rules []RepoRule) *RepoFilter + func (f *RepoFilter) IsAllowed(repoFullName string) bool + func (f *RepoFilter) IsAllowedBranch(repoFullName, branch string) bool + func (f *RepoFilter) IsAllowedRef(repoFullName, ref string) bool + type RepoRule struct + Branches []string + Pattern string + func ParseRepoRule(s string) RepoRule + type RepoStats struct + Branch string + EnqueuedAt time.Time + LastError string + LastErrorTime time.Time + LastSuccessTime time.Time + Processing bool + ProcessingAt time.Time + Queued bool + Repo string + type RetryConfig struct + BaseDelay time.Duration + MaxAttempts int + MaxDelay time.Duration + type Service struct + AttemptTimeout time.Duration + BuildScope BuildScopeLoader + Cache CacheInvalidator + Checkout Checkout + FailOnUnreadable bool + Graph GraphUpdater + Logger *slog.Logger + MaxFileBytes int64 + MaxTotalParsedBytes int64 + Observability Observability + func (s *Service) Sync(ctx context.Context, repoFullName, cloneURL, branch string) error + type SyncHandlerFunc func(ctx context.Context, repoFullName, cloneURL, branch string) error + type SyncQueue struct + func NewSyncQueue(workers int, handler SyncHandlerFunc) *SyncQueue + func NewSyncQueueWithConfig(ctx context.Context, workers int, handler SyncHandlerFunc, cfg QueueConfig) *SyncQueue + func NewSyncQueueWithContext(ctx context.Context, workers int, handler SyncHandlerFunc) *SyncQueue + func NewSyncQueueWithOptions(ctx context.Context, workers int, handler SyncHandlerFunc, retry RetryConfig) *SyncQueue + func (q *SyncQueue) Add(ctx context.Context, repoFullName, cloneURL, branch string) error + func (q *SyncQueue) Shutdown() + func (q *SyncQueue) Stats() SyncQueueStats + type SyncQueueStats struct + Dirty int + FailureTotal int64 + LastError string + LastErrorTime time.Time + LastSuccessTime time.Time + MaxTrackedRepos int + OldestProcessingAge time.Duration + OldestQueuedAge time.Duration + Processing int + QueueFullTotal int64 + Queued int + RecentRepos []RepoStats + Shutdown bool + TrackedRepos int + type UpdateStats struct + Added int + Deleted int + Modified int + Skipped int