installer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SymbolicsInfoFileName string = "symbolics.info"
)

Variables

View Source
var DefaultDecorator = func(dUrl string, ft *request.Fetcher) string {

	pxy := os.Getenv(conf.VMProxyEnvName)
	if gutils.VerifyUrls(pxy) || strings.Contains(pxy, "://") {
		if ft != nil {
			ft.Proxy = pxy
		}
		return dUrl
	}
	return conf.DecorateUrl(dUrl)
}

Functions

func IsCoursierInstalled added in v0.0.3

func IsCoursierInstalled() bool

func IsMinicondaInstalled

func IsMinicondaInstalled() bool

Types

type CondaInstaller

type CondaInstaller struct {
	AppName   string
	Version   string
	Searcher  *Searcher
	V         *versions.VersionItem
	Install   func(appName, version, zipFilePath string)
	UnInstall func(appName, version string)
	HomePage  string
}

Use miniconda as installer.

func NewCondaInstaller

func NewCondaInstaller() *CondaInstaller

func (*CondaInstaller) ClearCache

func (c *CondaInstaller) ClearCache()

func (*CondaInstaller) Copy

func (c *CondaInstaller) Copy()

func (*CondaInstaller) CreateBinarySymbol

func (c *CondaInstaller) CreateBinarySymbol()

func (*CondaInstaller) CreateVersionSymbol

func (c *CondaInstaller) CreateVersionSymbol()

func (*CondaInstaller) DeleteAll

func (c *CondaInstaller) DeleteAll()

func (*CondaInstaller) DeleteVersion

func (c *CondaInstaller) DeleteVersion()

func (*CondaInstaller) Download

func (c *CondaInstaller) Download() (zipFilePath string)

func (*CondaInstaller) GetHomepage

func (c *CondaInstaller) GetHomepage() string

func (*CondaInstaller) GetInstall

func (c *CondaInstaller) GetInstall() func(appName, version, zipFilePath string)

func (*CondaInstaller) InstallApp

func (c *CondaInstaller) InstallApp(zipFilePath string)

func (*CondaInstaller) SearchVersion

func (c *CondaInstaller) SearchVersion()

func (*CondaInstaller) SetEnv

func (c *CondaInstaller) SetEnv()

func (*CondaInstaller) SetVersion

func (c *CondaInstaller) SetVersion(version string)

func (*CondaInstaller) UnInstallApp

func (c *CondaInstaller) UnInstallApp()

func (*CondaInstaller) Unzip

func (c *CondaInstaller) Unzip(zipFilePath string)

type CoursierInstaller added in v0.0.3

type CoursierInstaller struct {
	AppName   string
	Version   string
	Searcher  *Searcher
	V         *versions.VersionItem
	Install   func(appName, version, zipFilePath string)
	UnInstall func(appName, version string)
	HomePage  string
}

Use coursier as installer for Scala.

https://get-coursier.io/docs/cli-install

func NewCoursierInstaller added in v0.0.3

func NewCoursierInstaller() *CoursierInstaller

func (*CoursierInstaller) ClearCache added in v0.0.3

func (c *CoursierInstaller) ClearCache()

func (*CoursierInstaller) Copy added in v0.0.3

func (c *CoursierInstaller) Copy()

func (*CoursierInstaller) CreateBinarySymbol added in v0.0.3

func (c *CoursierInstaller) CreateBinarySymbol()

func (*CoursierInstaller) CreateVersionSymbol added in v0.0.3

func (c *CoursierInstaller) CreateVersionSymbol()

func (*CoursierInstaller) DeleteAll added in v0.0.3

func (c *CoursierInstaller) DeleteAll()

func (*CoursierInstaller) DeleteVersion added in v0.0.3

func (c *CoursierInstaller) DeleteVersion()

func (*CoursierInstaller) Download added in v0.0.3

func (c *CoursierInstaller) Download() (zipFilePath string)

func (*CoursierInstaller) GetHomepage added in v0.0.3

func (c *CoursierInstaller) GetHomepage() string

func (*CoursierInstaller) GetInstall added in v0.0.3

func (c *CoursierInstaller) GetInstall() func(appName, version, zipFilePath string)

func (*CoursierInstaller) InstallApp added in v0.0.3

func (c *CoursierInstaller) InstallApp(zipFilePath string)

func (*CoursierInstaller) SearchVersion added in v0.0.3

func (c *CoursierInstaller) SearchVersion()

func (*CoursierInstaller) SetEnv added in v0.0.3

func (c *CoursierInstaller) SetEnv()

func (*CoursierInstaller) SetVersion added in v0.0.3

func (c *CoursierInstaller) SetVersion(version string)

func (*CoursierInstaller) UnInstallApp added in v0.0.3

func (c *CoursierInstaller) UnInstallApp()

func (*CoursierInstaller) Unzip added in v0.0.3

func (c *CoursierInstaller) Unzip(zipFilePath string)

type Env

type Env struct {
	Name  string
	Value string
}

type HomeDirFinder

type HomeDirFinder struct {
	Home      string
	FlagFiles []string // unique file names that only exists in Home Dir.
	ExceptDir bool
}

Find home dir of unzipped directories.

func NewFinder

func NewFinder(flagFiles ...string) (h *HomeDirFinder)

func (*HomeDirFinder) Find

func (h *HomeDirFinder) Find(startDir string)

type Installer

type Installer struct {
	AppName            string
	Version            string
	Searcher           *Searcher
	Fetcher            *request.Fetcher
	V                  *versions.VersionItem
	IsZipFile          bool
	BinaryRenameTo     string
	VersionFilter      func(dUrl string) bool
	BinDirGetter       func(version string) [][]string               // Binary dir
	BinListGetter      func() []string                               // Binaries
	FlagFileGetter     func() []string                               // Flags to find home dir of an app
	FlagDirExcepted    bool                                          // whether to find binaries only
	EnvGetter          func(appName, version string) []Env           // Envs to set
	DUrlDecorator      func(dUrl string, ft *request.Fetcher) string // Download url decorator
	PostInstall        func(appName, version string)                 // post install hook
	Install            func(appName, version, zipFileName string)    // customed installation.
	UnInstall          func(appName, version string)                 // customed uninstallation.
	StoreMultiVersions bool                                          // installs only the latest version if false
	ForceReDownload    bool                                          // force to redownload the cached zip file
	AddBinDirToPath    bool                                          // uses $PATH instead of creating symbolics
	NoDownload         bool                                          // diable download
	HomePage           string                                        // home page of the app
}

func NewInstaller

func NewInstaller(appName, version string) (i *Installer)

func (*Installer) ClearCache

func (i *Installer) ClearCache()

func (*Installer) Copy

func (i *Installer) Copy()

func (*Installer) CreateBinarySymbol

func (i *Installer) CreateBinarySymbol()

func (*Installer) CreateVersionSymbol

func (i *Installer) CreateVersionSymbol()

func (*Installer) DeleteAll

func (i *Installer) DeleteAll()

Removes all installed versions of an app.

func (*Installer) DeleteVersion

func (i *Installer) DeleteVersion()

Removes a version.

func (*Installer) Download

func (i *Installer) Download() (zipFilePath string)

func (*Installer) GetHomepage

func (i *Installer) GetHomepage() string

func (*Installer) GetInstall

func (i *Installer) GetInstall() func(appName, version, zipFileName string)

func (*Installer) InstallApp

func (i *Installer) InstallApp(zipFilePath string)

customed installation.

func (*Installer) SearchLatestVersion

func (i *Installer) SearchLatestVersion()

func (*Installer) SearchVersion

func (i *Installer) SearchVersion()

Searches version files for an application.

func (*Installer) SetEnv

func (i *Installer) SetEnv()

func (*Installer) SetVersion

func (i *Installer) SetVersion(version string)

func (*Installer) UnInstallApp

func (i *Installer) UnInstallApp()

uninstall.

func (*Installer) Unzip

func (i *Installer) Unzip(zipFilePath string)

type Searcher

type Searcher struct {
	VersionInfo *versions.VersionInfo
}

func NewSearcher

func NewSearcher() (s *Searcher)

func (*Searcher) GetVersions

func (s *Searcher) GetVersions(appName string) map[string]versions.VersionList

Gets version list.

func (*Searcher) Search

func (s *Searcher) Search(appName string)

Shows version list.

Jump to

Keyboard shortcuts

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