sources

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package sources provides abstractions for handling various types of installation sources, including GitHub repositories, direct URLs, Go projects, and command-based sources. The package defines a common interface, Populator, which is implemented by these sources to handle initialization, execution, versioning, path setup, and installation processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Populator added in v0.0.11

type Populator interface {
	Initialize(repo string) error
	Version(version string) error
	URL(name string, extensions []string, version string, requirements match.Requirements) error
	Install(data install.Data, progressListener getter.ProgressTracker) (string, file.File, error)
	Get(key string) string
}

Populator defines the interface that all source types must implement. It provides methods for managing the complete lifecycle of tool installation, from initialization through execution, versioning, path setup, and installation.

type Source

type Source struct {
	GitHub github.GitHub
	URL    url.URL
	Go     goc.Go
	Type   Type `validate:"oneof=github gitlab url none go"`
	GitLab gitlab.GitLab
}

Source represents the configuration for various source types used to retrieve tools. TODO(Idelchi): Add validation.

func (*Source) Installer

func (s *Source) Installer() (Populator, error)

Installer returns the appropriate Populator implementation for the source Type. Returns an error if the source type is unknown or unsupported.

type Type

type Type string

Type represents the installation source type for a tool.

const (
	// GITHUB indicates GitHub as the source type.
	GITHUB Type = "github"
	// GITLAB indicates GitLab as the source type.
	GITLAB Type = "gitlab"
	// URL indicates a direct URL as the source type.
	URL Type = "url"
	// NONE indicates no source type.
	NONE Type = "none"
	// GO indicates Go modules as the source type.
	GO Type = "go"
)

func (*Type) From

func (t *Type) From(name string)

From sets the Type value from the provided name string.

func (Type) String

func (t Type) String() string

String returns the string representation of the Type value.

func (Type) SupportsChecksum added in v0.1.3

func (t Type) SupportsChecksum() bool

SupportsChecksum returns true if the source type supports checksum verification.

Directories

Path Synopsis
Package github provides functionality for interacting with GitHub repositories, including fetching release information, matching assets to specific requirements, and downloading files from repository releases.
Package github provides functionality for interacting with GitHub repositories, including fetching release information, matching assets to specific requirements, and downloading files from repository releases.
Package gitlab provides functionality for interacting with GitLab repositories, including fetching release information, matching assets to specific requirements, and downloading files from repository releases.
Package gitlab provides functionality for interacting with GitLab repositories, including fetching release information, matching assets to specific requirements, and downloading files from repository releases.
Package goc provides functionality for handling Go-based installations and managing Go commands using GitHub repositories.
Package goc provides functionality for handling Go-based installations and managing Go commands using GitHub repositories.
Package install provides shared utilities and types used across various modules, including functions for handling downloads, metadata management, file operations, and installation processes.
Package install provides shared utilities and types used across various modules, including functions for handling downloads, metadata management, file operations, and installation processes.
Package none provides a no-op source implementation for tools that don't require external sources.
Package none provides a no-op source implementation for tools that don't require external sources.
Package url provides functionality to handle URLs as sources for downloading and managing files.
Package url provides functionality to handle URLs as sources for downloading and managing files.

Jump to

Keyboard shortcuts

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