Documentation
¶
Overview ¶
Package repo provides repository management for skill repositories.
Package repo provides repository management for skill repositories.
Index ¶
- Variables
- type Manager
- func (m *Manager) Add(url string, opts ...Option) (*config.RepoConfig, error)
- func (m *Manager) Get(name string) (*config.RepoConfig, error)
- func (m *Manager) List() ([]config.RepoConfig, error)
- func (m *Manager) Remove(name string) error
- func (m *Manager) Update(name string) error
- func (m *Manager) UpdateByPath(path string) error
- type Option
- type ValidationWarning
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("repository not found") ErrInvalidURL = errors.New("invalid git URL") ErrNameCollision = errors.New("repository with this name already exists") ErrInvalidName = errors.New("invalid repository name") ErrCacheCleanupFailed = errors.New("cache cleanup failed") )
Sentinel errors for repository operations.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages skill repositories.
func NewManager ¶
NewManager creates a new repository manager. The configPath specifies where the config file is stored.
func (*Manager) Add ¶
Add clones a repository and registers it in the config. Returns the created RepoConfig or an error.
func (*Manager) Get ¶
func (m *Manager) Get(name string) (*config.RepoConfig, error)
Get retrieves a repository by name.
func (*Manager) List ¶
func (m *Manager) List() ([]config.RepoConfig, error)
List returns all registered repositories. Returns an empty slice if no repositories are registered.
func (*Manager) Remove ¶
Remove unregisters a repository and deletes its cached clone. The config is persisted before deleting cached data to ensure consistent state if the operation fails partway through.
func (*Manager) Update ¶
Update pulls the latest changes for repositories. If name is provided, only that repository is updated. If name is empty, all repositories are updated.
func (*Manager) UpdateByPath ¶
UpdateByPath pulls the latest changes for a repository at the given path. This is more efficient when you already have the repo config and don't need to reload configuration.
type ValidationWarning ¶
type ValidationWarning struct {
// Path is the relative path within the repository where the issue was found.
Path string
// Message describes the validation issue.
Message string
}
ValidationWarning represents a non-fatal issue found during repository validation. Warnings are informational and do not block operations.
func ValidateRepoContent ¶
func ValidateRepoContent(repoPath string) []ValidationWarning
ValidateRepoContent checks a repository for structural issues and invalid resources. It returns warnings for missing directories and unparseable resource files. This function never returns an error - all issues are reported as warnings to avoid blocking operations.