distro

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotDistroRepo = fmt.Errorf("directory is not a distro (packages) or advisories repository")
View Source
var ErrNotPackagesRepo = fmt.Errorf("directory is not a distro (packages) repository")

Functions

This section is empty.

Types

type AbsoluteProperties added in v0.9.0

type AbsoluteProperties struct {
	// The Name of the distro, e.g. "Wolfi".
	Name string

	// DistroRepoOwner is the GitHub organization name that owns the packages repo.
	DistroRepoOwner string

	// DistroPackagesRepo is the name of the distro's packages repo.
	DistroPackagesRepo string

	// DistroAdvisoriesRepo is the name of the distro's advisories repo.
	DistroAdvisoriesRepo string

	// APKRepositoryURL is the URL to the distro's package repository (e.g.
	// "https://packages.wolfi.dev/os").
	APKRepositoryURL string

	// SupportedArchitectures is a list of architectures supported by the distro.
	SupportedArchitectures []string
}

AbsoluteProperties describe the aspects of the distro that are constant and not a function of any user's local environment.

func (AbsoluteProperties) AdvisoriesHTTPSCloneURL added in v0.16.0

func (ap AbsoluteProperties) AdvisoriesHTTPSCloneURL() string

func (AbsoluteProperties) AdvisoriesRemoteURLs added in v0.9.0

func (ap AbsoluteProperties) AdvisoriesRemoteURLs() []string

AdvisoriesRemoteURLs is the known set of possible git remote URLs of the advisories repo.

func (AbsoluteProperties) DistroRemoteURLs added in v0.9.0

func (ap AbsoluteProperties) DistroRemoteURLs() []string

DistroRemoteURLs is the known set of possible git remote URLs of the distro repo.

type Distro

type Distro struct {
	Local    LocalProperties
	Absolute AbsoluteProperties
}

Distro represents a wolfictl-compatible distro, along with important properties discovered about how the user interacts with the distro.

func Detect

func Detect() (Distro, error)

Detect tries to automatically detect which distro the user wants to operate on by trying to match the current working directory with a known repository for a distro's packages or advisories.

func DetectFromDir added in v0.9.0

func DetectFromDir(dir string) (Distro, error)

DetectFromDir tries to identify a Distro by inspecting the given directory to see if it is a repository for a distro's packages or advisories.

func DetectFromDirV2 added in v0.16.0

func DetectFromDirV2(dir string) (Distro, error)

DetectFromDirV2 tries to identify a Distro by inspecting the given directory to see if it is a repository for a distro's packages.

func DetectV2 added in v0.16.0

func DetectV2() (Distro, error)

DetectV2 tries to detect which distro the user wants to operate on by seeing if the current working directory is the distro's packages repo. No advisory-related repositories are detected.

type LocalProperties added in v0.9.0

type LocalProperties struct {
	// PackagesRepo is the context about the user's local clone of the distro's
	// packages repo.
	PackagesRepo LocalRepo

	// AdvisoriesRepo is the context about the user's local clone of the distro's
	// advisories repo.
	AdvisoriesRepo LocalRepo
}

LocalProperties describe the aspects of the distro that are specific to the context of the user's local environment.

type LocalRepo added in v0.9.0

type LocalRepo struct {
	// Dir is the path to the directory containing the user's clone of the repo.
	Dir string

	// UpstreamName is the name of the locally configured git remote that the
	// user's clone of the repo uses to reference the upstream repo.
	UpstreamName string

	// ForkPoint is the commit hash of the latest commit had in common between the
	// local repo and the upstream repo main branch.
	ForkPoint string
}

LocalRepo stores the context about a local git repository that is needed for interacting with this distro.

Jump to

Keyboard shortcuts

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