repo

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package repo provides repository management for skill repositories.

Package repo provides repository management for skill repositories.

Index

Constants

This section is empty.

Variables

View Source
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

func NewManager(configPath string) *Manager

NewManager creates a new repository manager. The configPath specifies where the config file is stored.

func (*Manager) Add

func (m *Manager) Add(url string, opts ...Option) (*config.RepoConfig, error)

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

func (m *Manager) Remove(name string) error

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

func (m *Manager) Update(name string) error

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

func (m *Manager) UpdateByPath(path string) error

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 Option

type Option func(*addOptions)

Option configures Add behavior.

func WithName

func WithName(name string) Option

WithName overrides the repository name derived from the URL.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL