Documentation
¶
Index ¶
- Constants
- Variables
- type CopyAction
- type Entry
- type ExtractAction
- type Git
- func (a *Git) FetchArchive(ctx context.Context, name, version string, platform fetcher.Platform) (io.ReadCloser, int64, error)
- func (a *Git) FetchSource(ctx context.Context, name, version string) (io.ReadCloser, int64, error)
- func (a *Git) Info(ctx context.Context, pkgName string) (*Package, error)
- func (a *Git) ListVersions(ctx context.Context, pkgName string) ([]string, error)
- func (a *Git) Summaries(ctx context.Context) ([]Summary, error)
- func (a *Git) Update(ctx context.Context) error
- type LocalDir
- func (a *LocalDir) FetchArchive(ctx context.Context, name, version string, platform fetcher.Platform) (io.ReadCloser, int64, error)
- func (a *LocalDir) FetchSource(ctx context.Context, name, version string) (io.ReadCloser, int64, error)
- func (a *LocalDir) Info(ctx context.Context, pkgName string) (*Package, error)
- func (a *LocalDir) ListVersions(ctx context.Context, pkgName string) ([]string, error)
- func (a *LocalDir) Summaries(ctx context.Context) ([]Summary, error)
- type MkdirAction
- type Multi
- func (m *Multi) Latest(ctx context.Context, pkgName string) (string, Entry, error)
- func (m *Multi) Locate(ctx context.Context, pkgName string) (Entry, *Package, error)
- func (m *Multi) Search(ctx context.Context, query string) []SearchResult
- func (m *Multi) UpdateAll(ctx context.Context) []UpdateResult
- func (m *Multi) UpdateOne(ctx context.Context, name string) error
- func (m *Multi) VersionsOf(ctx context.Context, pkgName string) []VersionResult
- type OCI
- func (a *OCI) FetchArchive(ctx context.Context, name, version string, platform fetcher.Platform) (io.ReadCloser, int64, error)
- func (a *OCI) FetchSource(ctx context.Context, name, version string) (io.ReadCloser, int64, error)
- func (a *OCI) Info(ctx context.Context, pkgName string) (*Package, error)
- func (a *OCI) ListVersions(ctx context.Context, pkgName string) ([]string, error)
- func (a *OCI) Summaries(ctx context.Context) ([]Summary, error)
- func (a *OCI) Update(ctx context.Context) error
- type Package
- type Phase
- type PhaseSteps
- type Reporter
- type RunAction
- type SearchResult
- type Source
- type Step
- type Summary
- type UnsupportedSchemaVersionError
- type UpdateResult
- type Updater
- type VersionEntry
- type VersionResult
Constants ¶
const DocsAnchor = "docs/catalog.md#schema-version"
const PackagesSubdir = "pkgs"
On-disk layout: <repoRoot>/<PackagesSubdir>/<name>/pkg.yaml.
const SupportedSchemaVersion = 1
Variables ¶
var ErrPackageNotFound = errors.New("package not found in catalog")
var ErrUnsupportedSchemaVersion error = UnsupportedSchemaVersionError{}
Functions ¶
This section is empty.
Types ¶
type CopyAction ¶
type ExtractAction ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
func (*Git) FetchArchive ¶
func (*Git) FetchSource ¶
func (*Git) ListVersions ¶
type LocalDir ¶
type LocalDir struct {
// contains filtered or unexported fields
}
func NewLocalDir ¶
func (*LocalDir) FetchArchive ¶
func (*LocalDir) FetchSource ¶
func (*LocalDir) ListVersions ¶
func (*LocalDir) Summaries ¶ added in v0.4.0
Summaries returns one Summary per package directory that holds a loadable pkg.yaml. A package whose pkg.yaml fails to load or validate is skipped with a warning, so one broken manifest does not blank the whole listing. A directory with no pkg.yaml is silently ignored.
type MkdirAction ¶
type MkdirAction struct {
Path string `yaml:"path"`
}
type Multi ¶
type Multi struct {
// contains filtered or unexported fields
}
func (*Multi) VersionsOf ¶
func (m *Multi) VersionsOf(ctx context.Context, pkgName string) []VersionResult
type OCI ¶ added in v0.3.0
type OCI struct {
// contains filtered or unexported fields
}
OCI is a catalog Source backed by an OCI registry: it mirrors the catalog image index at <base>/catalog into a local oras OCI-layout store, then reads each package's pkg.yaml from that mirror with verify-on-read. Archive/source blobs are not mirrored here; they stream through the fetcher.Engine.
func NewOCI ¶ added in v0.3.0
func NewOCI(cacheDir, configRef string, mirror *oci.Mirror, engine *fetcher.Engine, reporter Reporter) *OCI
NewOCI builds an OCI Source. configRef is "<base>[:<tag>][@<digest>]"; base and reference are split from it. mirror mirrors and serves catalog metadata; engine pulls archive/source blobs.
func (*OCI) FetchArchive ¶ added in v0.3.0
func (*OCI) FetchSource ¶ added in v0.3.0
func (*OCI) ListVersions ¶ added in v0.3.0
type Package ¶
type Package struct {
SchemaVersion int `yaml:"schemaVersion"`
Name string `yaml:"name"`
Description string `yaml:"description"`
License string `yaml:"license"`
Homepage string `yaml:"homepage"`
DependsOn []string `yaml:"dependsOn"`
BuildFromSource bool `yaml:"buildFromSource"`
Archive *fetcher.Artifact `yaml:"archive,omitempty"`
Source *fetcher.Artifact `yaml:"source,omitempty"`
Versions []VersionEntry `yaml:"versions"`
Build []Step `yaml:"build,omitempty"`
Install []Step `yaml:"install,omitempty"`
Test []Step `yaml:"test,omitempty"`
}
func LoadPackage ¶ added in v0.3.0
LoadPackage unmarshals YAML and rejects unsupported schemaVersion values. Pass origin="" when the caller renders it separately (e.g. linter Finding.File).
func (*Package) Phases ¶
func (p *Package) Phases() []PhaseSteps
type Phase ¶
type Phase string
Closed set; declarative.go and the linter iterate Phases() in order — keep in sync.
type PhaseSteps ¶
type SearchResult ¶
type Source ¶
type Source interface {
Summaries(ctx context.Context) ([]Summary, error)
ListVersions(ctx context.Context, pkgName string) ([]string, error)
Info(ctx context.Context, pkgName string) (*Package, error)
FetchArchive(ctx context.Context, name, version string, platform fetcher.Platform) (io.ReadCloser, int64, error)
FetchSource(ctx context.Context, name, version string) (io.ReadCloser, int64, error)
}
type Step ¶
type Step struct {
Extract *ExtractAction `yaml:"extract,omitempty"`
Copy *CopyAction `yaml:"copy,omitempty"`
Mkdir *MkdirAction `yaml:"mkdir,omitempty"`
Run *RunAction `yaml:"run,omitempty"`
}
type Summary ¶ added in v0.4.0
Summary is the lightweight per-package metadata used by search and completion: enough to display and match without fetching a full Package.
type UnsupportedSchemaVersionError ¶ added in v0.3.0
Origin is generic so OCI registry coordinates can ride the same field.
func (UnsupportedSchemaVersionError) Error ¶ added in v0.3.0
func (e UnsupportedSchemaVersionError) Error() string
func (UnsupportedSchemaVersionError) Is ¶ added in v0.3.0
func (e UnsupportedSchemaVersionError) Is(target error) bool