Documentation
¶
Overview ¶
Package remote looks tools up in the Terraform registry, Artifact Hub, npm, PyPI and the GitHub search API, for the resolver in package registry.
Index ¶
Constants ¶
const ( TerraformRegistryHost = "registry.terraform.io" ArtifactHubHost = "artifacthub.io" NPMHost = "registry.npmjs.org" PyPIHost = "pypi.org" )
Hosts of the package registries that Remote asks.
Variables ¶
This section is empty.
Functions ¶
func Hosts ¶
func Hosts() []string
Hosts returns the hosts Remote sends requests to, other than the GitHub API.
func ParseGitHubURL ¶
ParseGitHubURL returns the owner/repo of a GitHub URL in any of the forms package metadata uses (https, git+https, git+ssh, git@github.com:, github:) and the path inside the repository that a /tree/<ref>/ or /blob/<ref>/ URL points to.
Types ¶
type GitHubReader ¶ added in v0.11.0
type GitHubReader interface {
Tags(ctx context.Context, repo string) ([]string, error)
File(ctx context.Context, repo, ref, path string) ([]byte, error)
}
GitHubReader lists the tag names of a GitHub repository and reads a file at a ref.
type ImageReader ¶ added in v0.11.0
type ImageReader interface {
Tags(ctx context.Context, r oci.Ref) ([]string, error)
Source(ctx context.Context, r oci.Ref, tag string) (string, error)
URL(r oci.Ref) string
}
ImageReader lists an image's tags and reads its source label; oci.Client implements it.
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote is a registry.Finder that asks the Terraform registry, Artifact Hub, npm, PyPI, image registries and GitHub.
func New ¶
func New(hc *http.Client, search RepoSearcher, gh GitHubReader) *Remote
New returns a Remote that sends requests through hc, searches with search, and reads a chart repository's tags and a GitHub Pages Helm repository's index through gh.
func (*Remote) ChartRepo ¶ added in v0.10.0
ChartRepo returns the Artifact Hub repository at the Helm repository URL registryURL that has a chart called chart. For an oci:// URL it tries <url>/<chart> first, because Artifact Hub lists most OCI charts as a repository of their own. It reports false when none matches.
func (*Remote) Find ¶
Find implements registry.Finder.
func (*Remote) WithImages ¶ added in v0.11.0
func (r *Remote) WithImages(images ImageReader) *Remote
WithImages returns r with an image reader for image: lookups.