app

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 24 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

GetDefaultBinDir returns the bin directory

func WithBinDir

func WithBinDir(dir string) func(*App) error

WithBinDir sets the binaries directory

func WithDiscard

func WithDiscard() func(*App) error

WithDiscard sets the log output to /dev/null

func WithLogLevel

func WithLogLevel(l string) func(*App) error

WithLogLevel sets the binaries directory

Types

type App

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

App implements the core logic

func New

func New(o ...func(*App) error) (*App, error)

New create a new app instance

func (*App) CreateShimFor

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

CreateShimFor creates a shim for the distribution

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 versionsfor 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) 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(distribution, version string) error

Local sets the locally used version for application

func (*App) Search added in v0.8.0

func (a *App) Search(pfix string) []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

func (*App) SetDryRun added in v0.2.16

func (a *App) SetDryRun(v bool)

SetDryRun sets the operation mode to dry-run

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, cache bool, which ...string) error

Update fetches catalog of applications and updates available versions

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 liste of available software sources

type Sources

type Sources struct {
	// Name    string  `yaml:"name"`
	Description string           `yaml:"description"`
	Map         mapping.Remapper `yaml:"map"`
	List        list.List        `yaml:"list"`
	Fetch       fetch.Fetch      `yaml:"fetch"`
	Install     install.Install  `yaml:"install"`
}

Sources contains a software source definition

Jump to

Keyboard shortcuts

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