base

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstallDir = func() string {
	homeDir, err := os.UserHomeDir()
	if err != nil {
		panic(fmt.Errorf("failed to retrieve $HOME dir: %w", err))
	}
	return filepath.Join(homeDir, ".local", "bin", "backplane")
}()
View Source
var LatestDir = func() string {
	return filepath.Join(InstallDir, "latest")
}()

Functions

This section is empty.

Types

type Default

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

func NewDefault

func NewDefault(name string) Default

NewDefault creates a Default tool with the provided name

func NewDefaultWithExecutable

func NewDefaultWithExecutable(name, executable string) Default

NewDefaultWithExecutable creates a Default tool with the provided name and executableName

func (*Default) Configure

func (t *Default) Configure() error

Confiure is currently unused

func (*Default) ExecutableName

func (t *Default) ExecutableName() string

ExecutableName returns the main executable name of the tool that will be installed in latest if not defined it will be the name

func (*Default) Installed

func (t *Default) Installed() (bool, error)

Installed validates whether the tool has already been installed under the provided rootDir or not

func (*Default) InstalledVersion

func (t *Default) InstalledVersion() (string, error)

InstalledVersion returns the currently installed version of the tool

func (*Default) Name

func (t *Default) Name() string

Name returns the name of the tool

func (*Default) Remove

func (t *Default) Remove() error

Remove uninstalls the tool by deleting it's tool-unique directory under the provided rootDir and unlinking itself from the latestDir

func (*Default) SymlinkPath

func (t *Default) SymlinkPath() string

symlinkPath returns the path to the symlink created by this tool, given the latest directory

func (*Default) ToolDir

func (t *Default) ToolDir() string

toolDir returns this tool's specific directory given the root directory all tools are installed in

type Github

type Github struct {
	// Default defines the default tool implementation
	Default
	// Source defines the source of the tool in GitHub
	Source *github.Source
	// VersionInLatestTag in
	VersionInLatestTag bool
}

func (*Github) LatestVersion

func (t *Github) LatestVersion() (string, error)

type Mirror

type Mirror struct {
	// Default defines the default Tool implementation
	Default
	// Source defines the source of the tool in mirror.openshift.com
	Source *mirror.Source
	// BaseSlug refers to the base domain for the source
	BaseSlug string
}

func (*Mirror) LatestVersion

func (t *Mirror) LatestVersion() (string, error)

Jump to

Keyboard shortcuts

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