registry

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package registry provides an embedded image registry mapping binary names to install methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandTemplate

func ExpandTemplate(tmplStr, version string) (string, error)

ExpandTemplate renders a Go template string with Version substitution.

Types

type ImageRegistry

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

ImageRegistry holds the full set of known binaries and their install methods.

func Default

func Default() (*ImageRegistry, error)

Default returns the singleton ImageRegistry loaded from the embedded YAML.

func Load

func Load(data []byte) (*ImageRegistry, error)

Load parses registry YAML data into an ImageRegistry.

func (*ImageRegistry) All

func (r *ImageRegistry) All() map[string]RegistryEntry

All returns all registry entries.

func (*ImageRegistry) Lookup

func (r *ImageRegistry) Lookup(binName string) (RegistryEntry, bool)

Lookup returns the registry entry for a binary, if known.

type RegistryEntry

type RegistryEntry struct {
	Name           string   `yaml:"-"`                         // set from map key
	Apt            string   `yaml:"apt,omitempty"`             // Debian/Ubuntu package
	Apk            string   `yaml:"apk,omitempty"`             // Alpine package
	URL            string   `yaml:"url,omitempty"`             // Direct download URL template
	DefaultVersion string   `yaml:"default_version,omitempty"` // Fallback version
	Dest           string   `yaml:"dest,omitempty"`            // Install path (default: /usr/local/bin/<name>)
	Chmod          string   `yaml:"chmod,omitempty"`           // Permission bits (default: "0755")
	Heavy          bool     `yaml:"heavy,omitempty"`           // Use companion Docker image
	Image          string   `yaml:"image,omitempty"`           // Companion image template
	RequiresUbuntu bool     `yaml:"requires_ubuntu,omitempty"` // Incompatible with Alpine
	RequiresFirst  []string `yaml:"requires_first,omitempty"`  // Dependencies
	Run            []string `yaml:"run,omitempty"`             // Custom RUN lines
}

RegistryEntry describes how to install a single binary in a container image.

func (RegistryEntry) ResolveVersion

func (e RegistryEntry) ResolveVersion(explicit string) string

ResolveVersion returns the version to use: explicit > default.

Jump to

Keyboard shortcuts

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