manager

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package manager contains the manager struct that handles to life-cycle of Go SDK installations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoManager

type GoManager struct {
	// The root directory stores the installed SDKs as well as any configuration files.
	RootDirectory string
	// The collection of all currently installed versions of the Go SDK.
	InstalledVersions version.Collection
	// The currently selected version. The selected version is the release that is synced to the "selected" directory. Might
	// be nil, if no version is currently selected.
	SelectedVersion *version.Version
	// contains filtered or unexported fields
}

The GoManager is responsible for managing Go SDK installations. It know about the currently installed SDKs, the current active SDK and has means to install additional SDKs, change which SDK is currently selected and remove existing installations.

func NewManager

func NewManager(task *tasks.Task, rootDirectory string) (*GoManager, error)

NewManager is a constructor for the GoManager struct. It reads through the given root directory and detects the current state and initializes the GoManager instance accordingly.

func (*GoManager) Cleanup

func (m *GoManager) Cleanup() error

Cleanup is a function that removes all Go SDK installations that are currently not considered stable. Feedback is directly printed to the stdout or stderr, so nothing is returned here.

func (*GoManager) Install

func (m *GoManager) Install(versionNumber *version.Version, operatingSystem, arch string, releaseType releases.ReleaseType) error

Install is a function that installs new instances of the Go SDK. As installation parameters the version number, operating system and platform architecture are considered when choosing the correct installation artifacts. The releaseType parameter is used to limit the amount of accepted versions. Feedback is directly printed to the stdout or stderr, so nothing is returned here.

func (*GoManager) Select

func (m *GoManager) Select(versionNumber *version.Version) error

Select is a function that selects an existing installation of the Go SDK as the active one. Feedback is directly printed to the stdout or stderr, so nothing is returned here.

func (*GoManager) Uninstall

func (m *GoManager) Uninstall(versionNumber *version.Version) error

Uninstall is a function that removes an existing installation of the Go SDK. Feedback is directly printed to the stdout or stderr, so nothing is returned here.

func (*GoManager) UninstallAll

func (m *GoManager) UninstallAll() error

UninstallAll is a function that removes all current installations of the Go SDK.

func (*GoManager) Unselect

func (m *GoManager) Unselect() error

Unselect is a function that unselects an existing installation of the Go SDK as the active one. Feedback is directly printed to the stdout or stderr, so nothing is returned here.

Jump to

Keyboard shortcuts

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