sources

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 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 common.InstallData, 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
}

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 Type = "github" // GitHub source type
	GITLAB Type = "gitlab" // GitLab source type
	URL    Type = "url"    // URL source type
	NONE   Type = "none"   // No source type
	GO     Type = "go"     // Go source type
)

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.

Directories

Path Synopsis
Package common provides shared utilities and types used across various modules, including functions for handling downloads, metadata management, file operations, and installation processes.
Package common provides shared utilities and types used across various modules, including functions for handling downloads, metadata management, file operations, and installation processes.
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 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