sources

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 8 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, Populater, 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 Populater

type Populater interface {
	Initialize(repo string) error
	Exe() error
	Version(version string) error
	Path(name string, extensions []string, version string, requirements match.Requirements) error
	Install(data common.InstallData) (string, file.File, error)
	Get(key string) string
}

Populater defines the interface that all source types must implement to handle initialization, execution, versioning, path setup, and installation.

type Source

type Source struct {
	Type     Type             // Type of the source
	Github   github.GitHub    // GitHub repository source
	URL      url.URL          // URL source for direct downloads
	Go       goc.Go           // Go project source
	Commands command.Commands // Command-based source
}

Source represents a source of installation, which could be GitHub, URL, Go, or command-based.

func (*Source) Installer

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

Installer returns the appropriate Populater implementation based on the source Type. It determines the correct handling for GitHub, URL, Go, and command-based sources.

type Type

type Type string

Type represents the source type, such as GitHub, URL, Go, or command-based sources.

const (
	GITHUB  Type = "github"  // GitHub source type
	GITLAB  Type = "gitlab"  // GitLab source type
	DIRECT  Type = "url"     // URL source type
	COMMAND Type = "command" // Command-based source type
	GO      Type = "go"      // Go source type
	RUST    Type = "rust"    // Rust source type
)

func (*Type) From

func (t *Type) From(name string)

From sets the Type from the provided name.

func (Type) String

func (t Type) String() string

String returns the string representation of the Type.

Directories

Path Synopsis
Package command provides utilities to manage and execute shell commands.
Package command provides utilities to manage and execute shell commands.
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 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