Help us shape the future of Go! Take the 2026 Go Developer Survey

index

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package index is the format of a marketplace's signed index.json: every plugin, its versions, the manifest hash and the per-platform artifacts. The marketplace produces it, lockfile consumes it.

Index

Constants

View Source
const Schema = 1

Schema is the only index schema this package reads.

Variables

View Source
var ErrNotFound = errors.New("index: plugin version not found")

ErrNotFound is returned by Find for an unknown plugin or version.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	OS        string `json:"os"`
	Arch      string `json:"arch"`
	URL       string `json:"url"`
	SHA256    string `json:"sha256"`
	BundleURL string `json:"bundle_url"`
}

Artifact is one built binary; BundleURL is its cosign bundle.

type Index

type Index struct {
	Schema      int       `json:"schema"`
	Marketplace string    `json:"marketplace"`
	Generated   time.Time `json:"generated"`
	Plugins     []Plugin  `json:"plugins"`
}

func Parse

func Parse(b []byte) (Index, error)

Parse decodes an index strictly: unknown fields and other schemas are errors.

func (Index) Find

func (i Index) Find(name, version string) (Version, error)

Find returns one exact version of a plugin, yanked or not: the caller decides what a yanked version means.

type Plugin

type Plugin struct {
	Name     string    `json:"name"`
	Versions []Version `json:"versions"`
}

type Version

type Version struct {
	Version        string `json:"version"`
	ManifestURL    string `json:"manifest_url"`
	ManifestSHA256 string `json:"manifest_sha256"`
	// ManifestBundleURL is the cosign bundle of plugin.toml.
	ManifestBundleURL string     `json:"manifest_bundle_url"`
	Yanked            bool       `json:"yanked"`
	Artifacts         []Artifact `json:"artifacts"`
}

func (Version) Artifact

func (v Version) Artifact(os, arch string) (Artifact, bool)

Artifact returns the artifact built for os/arch.

Jump to

Keyboard shortcuts

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