Versions in this module Expand all Collapse all v1 v1.0.0 Jan 6, 2026 Changes in this version + const ConfigName + const ErrCheckoutFailed + const ErrComplianceFailed + const ErrInvalidURL + const ErrNotInitialized + const ErrPathNotFound + const ErrRefCheckoutFailed + const ErrStaleCommitMsg + const ErrVendorNotFound + const LicenseDir + const LockName + const VendorDir + var AllowedLicenses = []string + var LicenseFileNames = []string + var Verbose = false + func ComputeAutoPath(sourcePath, defaultTarget, fallbackName string) string + func FindVendor(vendors []types.VendorSpec, name string) *types.VendorSpec + func FindVendorIndex(vendors []types.VendorSpec, name string) int + func ForEachMapping(vendor *types.VendorSpec, ...) error + func ForEachVendor(config types.VendorConfig, fn func(types.VendorSpec) error) error + func FormatDiffOutput(diff *types.VendorDiff) string + func IsGitInstalled() bool + func IsVendorInitialized() bool + func ParseSmartURL(rawURL string) (baseURL, ref, path string) + func Pluralize(count int, singular, plural string) string + func ValidateDestPath(destPath string) error + type CacheStore interface + BuildCache func(vendorName, ref, commitHash string, files []string) (types.IncrementalSyncCache, error) + ComputeFileChecksum func(path string) (string, error) + Delete func(vendorName, ref string) error + Load func(vendorName, ref string) (types.IncrementalSyncCache, error) + Save func(cache *types.IncrementalSyncCache) error + type ConfigStore interface + Load func() (types.VendorConfig, error) + Path func() string + Save func(config types.VendorConfig) error + type CopyStats struct + ByteCount int64 + FileCount int + func (s *CopyStats) Add(other CopyStats) + type FallbackLicenseChecker struct + func NewFallbackLicenseChecker(fs FileSystem, gitClient GitClient) *FallbackLicenseChecker + func (c *FallbackLicenseChecker) CheckLicense(repoURL string) (string, error) + type FileCacheStore struct + func NewFileCacheStore(fs FileSystem, rootDir string) *FileCacheStore + func (s *FileCacheStore) BuildCache(vendorName, ref, commitHash string, files []string) (types.IncrementalSyncCache, error) + func (s *FileCacheStore) ComputeFileChecksum(path string) (string, error) + func (s *FileCacheStore) Delete(vendorName, ref string) error + func (s *FileCacheStore) Load(vendorName, ref string) (types.IncrementalSyncCache, error) + func (s *FileCacheStore) Save(cache *types.IncrementalSyncCache) error + type FileConfigStore struct + func NewFileConfigStore(rootDir string) *FileConfigStore + func (s *FileConfigStore) Load() (types.VendorConfig, error) + func (s *FileConfigStore) Path() string + func (s *FileConfigStore) Save(cfg types.VendorConfig) error + type FileCopyService struct + func NewFileCopyService(fs FileSystem) *FileCopyService + func (s *FileCopyService) CopyMappings(tempDir string, vendor *types.VendorSpec, spec types.BranchSpec) (CopyStats, error) + type FileLockStore struct + func NewFileLockStore(rootDir string) *FileLockStore + func (s *FileLockStore) GetHash(vendorName, ref string) string + func (s *FileLockStore) Load() (types.VendorLock, error) + func (s *FileLockStore) Path() string + func (s *FileLockStore) Save(lock types.VendorLock) error + type FileSystem interface + CopyDir func(src, dst string) (CopyStats, error) + CopyFile func(src, dst string) (CopyStats, error) + CreateTemp func(dir, pattern string) (string, error) + MkdirAll func(path string, perm os.FileMode) error + ReadDir func(path string) ([]string, error) + Remove func(path string) error + RemoveAll func(path string) error + Stat func(path string) (os.FileInfo, error) + type GitClient interface + AddRemote func(dir, name, url string) error + Checkout func(dir, ref string) error + Clone func(dir, url string, opts *types.CloneOptions) error + Fetch func(dir string, depth int, ref string) error + FetchAll func(dir string) error + GetCommitLog func(dir, oldHash, newHash string, maxCount int) ([]types.CommitInfo, error) + GetHeadHash func(dir string) (string, error) + Init func(dir string) error + ListTree func(dir, ref, subdir string) ([]string, error) + type GitHubLicenseChecker struct + func NewGitHubLicenseChecker(httpClient *http.Client, allowedLicenses []string) *GitHubLicenseChecker + func (c *GitHubLicenseChecker) CheckLicense(rawURL string) (string, error) + func (c *GitHubLicenseChecker) IsAllowed(license string) bool + type GitLabAPIChecker struct + func NewGitLabAPIChecker() *GitLabAPIChecker + func (c *GitLabAPIChecker) CheckLicense(repoURL string) (string, error) + type HookExecutor interface + ExecutePostSync func(vendor *types.VendorSpec, ctx *types.HookContext) error + ExecutePreSync func(vendor *types.VendorSpec, ctx *types.HookContext) error + func NewHookService(ui UICallback) HookExecutor + type JSONError struct + Message string + Title string + type JSONOutput struct + Data map[string]interface{} + Error *JSONError + Message string + Status string + type LicenseChecker interface + CheckLicense func(url string) (string, error) + IsAllowed func(license string) bool + type LicenseService struct + func NewLicenseService(licenseChecker LicenseChecker, fs FileSystem, rootDir string, ui UICallback) *LicenseService + func (s *LicenseService) CheckCompliance(url string) (string, error) + func (s *LicenseService) CheckLicense(url string) (string, error) + func (s *LicenseService) CopyLicense(tempDir, vendorName string) error + func (s *LicenseService) GetLicensePath(vendorName string) string + type LockStore interface + GetHash func(vendorName, ref string) string + Load func() (types.VendorLock, error) + Path func() string + Save func(lock types.VendorLock) error + type Manager struct + RootDir string + func NewManager() *Manager + func NewManagerWithSyncer(syncer *VendorSyncer) *Manager + func (m *Manager) AddVendor(spec *types.VendorSpec) error + func (m *Manager) Audit() + func (m *Manager) CheckGitHubLicense(rawURL string) (string, error) + func (m *Manager) CheckSyncStatus() (types.SyncStatus, error) + func (m *Manager) CheckUpdates() ([]types.UpdateCheckResult, error) + func (m *Manager) ConfigPath() string + func (m *Manager) DetectConflicts() ([]types.PathConflict, error) + func (m *Manager) DiffVendor(vendorName string) ([]types.VendorDiff, error) + func (m *Manager) FetchRepoDir(url, ref, subdir string) ([]string, error) + func (m *Manager) GetConfig() (types.VendorConfig, error) + func (m *Manager) GetLockHash(vendorName, ref string) string + func (m *Manager) Init() error + func (m *Manager) LicensePath(name string) string + func (m *Manager) ListLocalDir(path string) ([]string, error) + func (m *Manager) LockPath() string + func (m *Manager) ParseSmartURL(rawURL string) (string, string, string) + func (m *Manager) RemoveVendor(name string) error + func (m *Manager) SaveVendor(spec *types.VendorSpec) error + func (m *Manager) SetUICallback(ui UICallback) + func (m *Manager) Sync() error + func (m *Manager) SyncDryRun() error + func (m *Manager) SyncWithGroup(groupName string, force, noCache bool) error + func (m *Manager) SyncWithOptions(vendorName string, force, noCache bool) error + func (m *Manager) SyncWithParallel(vendorName string, force, noCache bool, parallelOpts types.ParallelOptions) error + func (m *Manager) UpdateAll() error + func (m *Manager) UpdateAllWithParallel(parallelOpts types.ParallelOptions) error + func (m *Manager) UpdateVerboseMode(verbose bool) + func (m *Manager) ValidateConfig() error + func (m *Manager) WatchConfig(callback func() error) error + type MultiPlatformLicenseChecker struct + func NewMultiPlatformLicenseChecker(registry *providers.ProviderRegistry, fs FileSystem, gitClient GitClient, ...) *MultiPlatformLicenseChecker + func (c *MultiPlatformLicenseChecker) CheckLicense(url string) (string, error) + func (c *MultiPlatformLicenseChecker) GetProviderName(url string) string + func (c *MultiPlatformLicenseChecker) IsAllowed(license string) bool + type NoOpProgressTracker struct + func (t *NoOpProgressTracker) Complete() + func (t *NoOpProgressTracker) Fail(_ error) + func (t *NoOpProgressTracker) Increment(_ string) + func (t *NoOpProgressTracker) SetTotal(_ int) + type NonInteractiveFlags struct + Mode OutputMode + Yes bool + type OSFileSystem struct + func NewOSFileSystem() *OSFileSystem + func (fs *OSFileSystem) CopyDir(src, dst string) (CopyStats, error) + func (fs *OSFileSystem) CopyFile(src, dst string) (CopyStats, error) + func (fs *OSFileSystem) CreateTemp(dir, pattern string) (string, error) + func (fs *OSFileSystem) MkdirAll(path string, perm os.FileMode) error + func (fs *OSFileSystem) ReadDir(path string) ([]string, error) + func (fs *OSFileSystem) Remove(path string) error + func (fs *OSFileSystem) RemoveAll(path string) error + func (fs *OSFileSystem) Stat(path string) (os.FileInfo, error) + type OutputMode int + const OutputJSON + const OutputNormal + const OutputQuiet + type ParallelExecutor struct + func NewParallelExecutor(opts types.ParallelOptions, ui UICallback) *ParallelExecutor + func (p *ParallelExecutor) ExecuteParallelSync(vendors []types.VendorSpec, lockMap map[string]map[string]string, ...) ([]VendorResult, error) + func (p *ParallelExecutor) ExecuteParallelUpdate(vendors []types.VendorSpec, updateFunc UpdateVendorFunc) ([]VendorResult, error) + type PathOwner struct + Mapping types.PathMapping + Ref string + VendorName string + type RemoteExplorer struct + func NewRemoteExplorer(gitClient GitClient, fs FileSystem) *RemoteExplorer + func (e *RemoteExplorer) FetchRepoDir(url, ref, subdir string) ([]string, error) + func (e *RemoteExplorer) GetProviderName(url string) string + func (e *RemoteExplorer) ListLocalDir(path string) ([]string, error) + func (e *RemoteExplorer) ParseSmartURL(rawURL string) (string, string, string) + type SilentUICallback struct + func (s *SilentUICallback) AskConfirmation(_, _ string) bool + func (s *SilentUICallback) FormatJSON(_ JSONOutput) error + func (s *SilentUICallback) GetOutputMode() OutputMode + func (s *SilentUICallback) IsAutoApprove() bool + func (s *SilentUICallback) ShowError(_, _ string) + func (s *SilentUICallback) ShowLicenseCompliance(_ string) + func (s *SilentUICallback) ShowSuccess(_ string) + func (s *SilentUICallback) ShowWarning(_, _ string) + func (s *SilentUICallback) StartProgress(_ int, _ string) types.ProgressTracker + func (s *SilentUICallback) StyleTitle(title string) string + type SyncOptions struct + DryRun bool + Force bool + GroupName string + NoCache bool + Parallel types.ParallelOptions + VendorName string + type SyncService struct + func NewSyncService(configStore ConfigStore, lockStore LockStore, gitClient GitClient, ...) *SyncService + func (s *SyncService) Sync(opts SyncOptions) error + type SyncVendorFunc func(v types.VendorSpec, lockedRefs map[string]string, opts SyncOptions) (map[string]string, CopyStats, error) + type SystemGitClient struct + func NewSystemGitClient(verbose bool) *SystemGitClient + func (g *SystemGitClient) AddRemote(dir, name, url string) error + func (g *SystemGitClient) Checkout(dir, ref string) error + func (g *SystemGitClient) Clone(dir, url string, opts *types.CloneOptions) error + func (g *SystemGitClient) Fetch(dir string, depth int, ref string) error + func (g *SystemGitClient) FetchAll(dir string) error + func (g *SystemGitClient) GetCommitLog(dir, oldHash, newHash string, maxCount int) ([]types.CommitInfo, error) + func (g *SystemGitClient) GetHeadHash(dir string) (string, error) + func (g *SystemGitClient) Init(dir string) error + func (g *SystemGitClient) ListTree(dir, ref, subdir string) ([]string, error) + type UICallback interface + AskConfirmation func(title, message string) bool + FormatJSON func(output JSONOutput) error + GetOutputMode func() OutputMode + IsAutoApprove func() bool + ShowError func(title, message string) + ShowLicenseCompliance func(license string) + ShowSuccess func(message string) + ShowWarning func(title, message string) + StartProgress func(total int, label string) types.ProgressTracker + StyleTitle func(title string) string + type UpdateChecker struct + func NewUpdateChecker(configStore ConfigStore, lockStore LockStore, gitClient GitClient, ...) *UpdateChecker + func (c *UpdateChecker) CheckUpdates() ([]types.UpdateCheckResult, error) + type UpdateService struct + func NewUpdateService(configStore ConfigStore, lockStore LockStore, syncService *SyncService, ...) *UpdateService + func (s *UpdateService) UpdateAll() error + func (s *UpdateService) UpdateAllWithOptions(parallelOpts types.ParallelOptions) error + type UpdateVendorFunc func(v types.VendorSpec, opts SyncOptions) (map[string]string, error) + type ValidationService struct + func NewValidationService(configStore ConfigStore) *ValidationService + func (s *ValidationService) DetectConflicts() ([]types.PathConflict, error) + func (s *ValidationService) ValidateConfig() error + type VendorRepository struct + func NewVendorRepository(configStore ConfigStore) *VendorRepository + func (r *VendorRepository) Delete(name string) error + func (r *VendorRepository) Exists(name string) (bool, error) + func (r *VendorRepository) Find(name string) (*types.VendorSpec, error) + func (r *VendorRepository) FindAll() ([]types.VendorSpec, error) + func (r *VendorRepository) GetConfig() (types.VendorConfig, error) + func (r *VendorRepository) Save(vendor *types.VendorSpec) error + type VendorResult struct + Error error + Stats CopyStats + UpdatedRefs map[string]string + Vendor types.VendorSpec + type VendorSyncer struct + func NewVendorSyncer(configStore ConfigStore, lockStore LockStore, gitClient GitClient, ...) *VendorSyncer + func (s *VendorSyncer) AddVendor(spec *types.VendorSpec) error + func (s *VendorSyncer) Audit() + func (s *VendorSyncer) CheckGitHubLicense(url string) (string, error) + func (s *VendorSyncer) CheckSyncStatus() (types.SyncStatus, error) + func (s *VendorSyncer) CheckUpdates() ([]types.UpdateCheckResult, error) + func (s *VendorSyncer) DetectConflicts() ([]types.PathConflict, error) + func (s *VendorSyncer) DiffVendor(vendorName string) ([]types.VendorDiff, error) + func (s *VendorSyncer) FetchRepoDir(url, ref, subdir string) ([]string, error) + func (s *VendorSyncer) GetConfig() (types.VendorConfig, error) + func (s *VendorSyncer) GetLockHash(vendorName, ref string) string + func (s *VendorSyncer) Init() error + func (s *VendorSyncer) ListLocalDir(path string) ([]string, error) + func (s *VendorSyncer) ParseSmartURL(rawURL string) (string, string, string) + func (s *VendorSyncer) RemoveVendor(name string) error + func (s *VendorSyncer) SaveVendor(spec *types.VendorSpec) error + func (s *VendorSyncer) Sync() error + func (s *VendorSyncer) SyncDryRun() error + func (s *VendorSyncer) SyncWithGroup(groupName string, force, noCache bool) error + func (s *VendorSyncer) SyncWithOptions(vendorName string, force, noCache bool) error + func (s *VendorSyncer) SyncWithParallel(vendorName string, force, noCache bool, parallelOpts types.ParallelOptions) error + func (s *VendorSyncer) UpdateAll() error + func (s *VendorSyncer) UpdateAllWithParallel(parallelOpts types.ParallelOptions) error + func (s *VendorSyncer) ValidateConfig() error + func (s *VendorSyncer) WatchConfig(callback func() error) error + type YAMLStore struct + func NewYAMLStore[T any](rootDir, filename string, allowMissing bool) *YAMLStore[T] + func (s *YAMLStore[T]) Load() (T, error) + func (s *YAMLStore[T]) Path() string + func (s *YAMLStore[T]) Save(data T) error