app

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyInstalled is returned when the requested version is already installed
	ErrAlreadyInstalled = errors.New("version already installed")
)

Functions

func GetDefaultBinDir

func GetDefaultBinDir() (string, error)

GetDefaultBinDir returns the bin directory in usermode

func GetDefaultCacheDir added in v0.19.0

func GetDefaultCacheDir() (string, error)

GetDefaultCacheDir returns the cache directory in usermode

func GetDefaultConfDir added in v0.19.0

func GetDefaultConfDir() (string, error)

GetDefaultConfDir returns the config directory in usermode

func GetDefaultLinkDir added in v0.19.0

func GetDefaultLinkDir() (string, error)

GetDefaultLinkDir returns the bin directory in usermode

func WithDiscard

func WithDiscard() func(*App) error

WithDiscard sets the log output to /dev/null

Types

type App

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

App implements the core logic

func New

func New() (*App, error)

New creates a new App

func (*App) CreateShimFor

func (a *App) CreateShimFor(dist string) error

CreateShimFor creates a shim for the distribution

func (*App) DumpConfig added in v0.19.0

func (a *App) DumpConfig()

DumpConfig dumps the configuration to stdout

func (*App) Execute

func (a *App) Execute(args []string)

Execute runs the shim function that executes real distributions

func (*App) GetAvailableVersionsFor

func (a *App) GetAvailableVersionsFor(dist string) []string

GetAvailableVersionsFor returns a list of versions available for distribution

func (*App) GetInstalledVersionsFor

func (a *App) GetInstalledVersionsFor(dist string) []string

GetInstalledVersionsFor returns a sorted list of versions for distribution

func (*App) GetMostRecent

func (a *App) GetMostRecent(dist string) string

GetMostRecent returns the most recent stable available version

func (*App) GetPackagesListWithPrefix

func (a *App) GetPackagesListWithPrefix(pfix string) []string

GetPackagesListWithPrefix returns a list of packages that starts with prefix

func (*App) GuessBestVersionFor

func (a *App) GuessBestVersionFor(dist, dir, stop string, versions []string) (string, string)

GuessBestVersionFor returns closest version requirement given a location, a distribution and a version list. If no match we return the latest version we have

func (*App) GuessBestVersionFor2 added in v0.2.16

func (a *App) GuessBestVersionFor2(dist, dir string, versions []string) (string, string)

GuessBestVersionFor2 returns closest version requirement given a location, a distribution and a version list. If no match we return the latest version we have

func (*App) Init added in v0.19.0

func (a *App) Init(o ...func(*App) error) error

Init prepares App for use

func (*App) Install

func (a *App) Install(specs ...string) error

Install installs or update a distribution

func (*App) InstallFromLock added in v0.2.15

func (a *App) InstallFromLock() error

InstallFromLock install distributions/versions to match the local .binenv.lock file

func (*App) Local

func (a *App) Local(specs ...string) error

Local sets the locally used version for application

func (*App) Search added in v0.8.0

func (a *App) Search(pfix string, wide bool) []string

Search show a list returns a list of packages contains string in name or description

func (*App) SetBinDir

func (a *App) SetBinDir(d string) error

SetBinDir sets bin directory to use the first non-empty argument

func (*App) SetCacheDir added in v0.19.0

func (a *App) SetCacheDir(d string) error

SetCacheDir sets cache directory to use

func (*App) SetConcurrency added in v0.14.0

func (a *App) SetConcurrency(c int)

SetConcurrency sets the number of goroutines for cache update

func (*App) SetConfigDir added in v0.19.0

func (a *App) SetConfigDir(d string) error

SetConfigDir sets config directory to use

func (*App) SetDryRun added in v0.2.16

func (a *App) SetDryRun(v bool)

SetDryRun sets the operation mode to dry-run

func (*App) SetFlag added in v0.18.0

func (a *App) SetFlag(name string, value bool)

SetFlag call a setter function if exists

func (*App) SetGlobal added in v0.19.0

func (a *App) SetGlobal(g bool)

SetGlobal configures binenv to run in system-wide mode

func (*App) SetLinkDir added in v0.19.0

func (a *App) SetLinkDir(d string) error

SetLinkDir sets link directory to use

func (*App) SetLogLevel

func (a *App) SetLogLevel(l string) error

SetLogLevel sets the log level to use

func (*App) SetVerbose added in v0.2.14

func (a *App) SetVerbose(v bool)

SetVerbose sets the log level to debug

func (*App) Uninstall

func (a *App) Uninstall(specs ...string) error

Uninstall installs or update a distribution

func (*App) Update

func (a *App) Update(definitions, all bool, nocache bool, which ...string) error

Update fetches catalog of applications and updates available versions

func (*App) Upgrade added in v0.18.0

func (a *App) Upgrade(ignoreInstallErrors bool) error

Upgrade install last version of all locally installed distributions

func (*App) Versions

func (a *App) Versions(freezemode bool, specs ...string) error

Versions fetches available versions for the application

type Distributions

type Distributions struct {
	Sources map[string]Sources `yaml:"sources"`
}

Distributions holds the list of available software sources

type Sources

type Sources struct {
	// Name    string  `yaml:"name"`
	Description        string              `yaml:"description"`
	URL                string              `yaml:"url"`
	Map                mapping.Remapper    `yaml:"map"`
	List               list.List           `yaml:"list"`
	Fetch              fetch.Fetch         `yaml:"fetch"`
	Install            install.Install     `yaml:"install"`
	PostInstallMessage string              `yaml:"post_install_message"`
	SupportedPlatforms []platform.Platform `yaml:"supported_platforms"`
}

Sources contains a software source definition

Jump to

Keyboard shortcuts

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