remote

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

func ParseGitHubURL(raw string) (string, string, bool)

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 Remote

type Remote struct {
	// contains filtered or unexported fields
}

Remote is a registry.Finder that asks the Terraform registry, Artifact Hub, npm, PyPI and GitHub.

func New

func New(hc *http.Client, search RepoSearcher, tags TagLister) *Remote

New returns a Remote that sends requests through hc, searches with search and reads a chart repository's tags with tags.

func (*Remote) ChartRepo added in v0.10.0

func (r *Remote) ChartRepo(ctx context.Context, registryURL, chart string) (string, bool, error)

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

func (r *Remote) Find(ctx context.Context, kind, name string) (*registry.Found, error)

Find implements registry.Finder.

type RepoHit

type RepoHit struct {
	FullName string
	Stars    int
}

RepoHit is one repository in a GitHub search result.

type RepoSearcher

type RepoSearcher interface {
	SearchRepos(ctx context.Context, name string) ([]RepoHit, error)
}

RepoSearcher searches GitHub repositories by name.

type TagLister added in v0.10.0

type TagLister interface {
	Tags(ctx context.Context, repo string) ([]string, error)
}

TagLister lists the tag names of a GitHub repository.

Jump to

Keyboard shortcuts

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