Documentation
¶
Overview ¶
Package repository provides plugin repository management for Tinct.
Package repository provides plugin repository management for Tinct.
Package repository provides plugin repository management for Tinct.
Index ¶
- Constants
- func NormalizePlatform(goos, goarch string) string
- type CacheConfig
- type Config
- type Download
- type Manager
- func (m *Manager) AddRepository(name, url string) error
- func (m *Manager) FindPlugin(name, version string) (*SearchResult, error)
- func (m *Manager) FindPluginInRepository(repoName, pluginName, version string) (*SearchResult, error)
- func (m *Manager) GetRepository(name string) (*Repository, error)
- func (m *Manager) ListRepositories() []*Repository
- func (m *Manager) RemoveRepository(name string) error
- func (m *Manager) Search(filter SearchFilter) ([]*SearchResult, error)
- func (m *Manager) UpdateAllRepositories() error
- func (m *Manager) UpdateRepository(name string) error
- type Manifest
- type Plugin
- type PluginSource
- type Repository
- type SearchFilter
- type SearchResult
- type SyncStats
- type VerifyResult
- type Version
Constants ¶
const OfficialRepoURL = "https://raw.githubusercontent.com/jmylchreest/tinct-plugins/refs/heads/main/repository/repository.json"
OfficialRepoURL is the URL for the official Tinct plugin repository.
Variables ¶
This section is empty.
Functions ¶
func NormalizePlatform ¶ added in v0.0.5
NormalizePlatform converts Go's GOOS/GOARCH to repository platform naming. Repository uses "x86" instead of "amd64" for compatibility with other languages.
Types ¶
type CacheConfig ¶
type CacheConfig struct {
TTL int `json:"ttl"` // Cache TTL in seconds
LastUpdate map[string]int64 `json:"last_update"` // repo name -> unix timestamp
}
CacheConfig contains cache settings.
type Config ¶
type Config struct {
Repositories []*Repository `json:"repositories"`
Cache *CacheConfig `json:"cache,omitempty"`
}
Config contains all configured repositories.
type Download ¶
type Download struct {
URL string `json:"url"`
Checksum string `json:"checksum"` // Format: "sha256:..."
Size int64 `json:"size,omitempty"`
Runtime string `json:"runtime,omitempty"` // e.g., "python3", "bash"
Dependencies []string `json:"dependencies,omitempty"` // Runtime dependencies
Available bool `json:"available"`
LastVerified *time.Time `json:"last_verified,omitempty"`
}
Download represents a downloadable artifact for a specific platform.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles plugin repository operations.
func NewManager ¶
NewManager creates a new repository manager.
func (*Manager) AddRepository ¶
AddRepository adds a new repository.
func (*Manager) FindPlugin ¶
func (m *Manager) FindPlugin(name, version string) (*SearchResult, error)
FindPlugin finds a specific plugin by name across all repositories.
func (*Manager) FindPluginInRepository ¶
func (m *Manager) FindPluginInRepository(repoName, pluginName, version string) (*SearchResult, error)
FindPluginInRepository finds a plugin in a specific repository.
func (*Manager) GetRepository ¶
func (m *Manager) GetRepository(name string) (*Repository, error)
GetRepository returns a repository by name.
func (*Manager) ListRepositories ¶
func (m *Manager) ListRepositories() []*Repository
ListRepositories returns all configured repositories.
func (*Manager) RemoveRepository ¶
RemoveRepository removes a repository by name.
func (*Manager) Search ¶
func (m *Manager) Search(filter SearchFilter) ([]*SearchResult, error)
Search searches for plugins across all repositories.
func (*Manager) UpdateAllRepositories ¶
UpdateAllRepositories refreshes all repositories.
func (*Manager) UpdateRepository ¶
UpdateRepository refreshes a repository's manifest.
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
Name string `json:"name"`
Description string `json:"description"`
URL string `json:"url"`
MaintainedBy string `json:"maintained_by,omitempty"`
LastUpdated time.Time `json:"last_updated"`
LastPruned *time.Time `json:"last_pruned,omitempty"`
Plugins map[string]*Plugin `json:"plugins"`
}
Manifest represents a plugin repository manifest.
type Plugin ¶
type Plugin struct {
Name string `json:"name"`
Type string `json:"type"` // "input" or "output"
Description string `json:"description"`
Repository string `json:"repository"`
Author string `json:"author,omitempty"`
License string `json:"license,omitempty"`
Tags []string `json:"tags,omitempty"`
Versions []Version `json:"versions"`
}
Plugin represents a plugin in the repository.
type PluginSource ¶
type PluginSource struct {
Type string `json:"type"` // "repository", "http", "local"
Repository string `json:"repository,omitempty"`
Plugin string `json:"plugin,omitempty"`
Version string `json:"version,omitempty"`
URL string `json:"url,omitempty"`
Checksum string `json:"checksum,omitempty"`
OriginalPath string `json:"original_path,omitempty"`
}
PluginSource represents where a plugin was installed from.
type Repository ¶
type Repository struct {
Name string `json:"name"`
URL string `json:"url"`
Manifest *Manifest `json:"-"` // Cached manifest (not persisted)
}
Repository represents a configured plugin repository.
type SearchFilter ¶
type SearchFilter struct {
Query string
Type string // "input" or "output"
Tags []string
Author string
Repository string
}
SearchFilter contains criteria for searching plugins.
type SearchResult ¶
SearchResult represents a plugin found in search.
type VerifyResult ¶
type VerifyResult struct {
Name string
Status string // "valid", "mismatch", "missing", "no_checksum"
Error error
Expected string
Got string
}
VerifyResult represents the result of verifying a plugin.
type Version ¶
type Version struct {
Version string `json:"version"`
Released time.Time `json:"released"`
Compatibility string `json:"compatibility,omitempty"` // e.g., ">=1.0.0"
ChangelogURL string `json:"changelog_url,omitempty"`
Downloads map[string]*Download `json:"downloads"`
}
Version represents a specific version of a plugin.