Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoInstaller ¶
type GoInstaller struct { // Name is the name of the project to install Name string // Dir is the directory where projects will be installed. They will // be installed to a sub-directory of the project name. Example: // if Dir is "/foo", then the Packer binary would be installed to // "/foo/packer/packer" Dir string // Ui is the Otto UI for asking the user for input and outputting // the status of installation. Ui ui.Ui }
GoInstaller is an Installer that knows how to install Go projects.
func (*GoInstaller) Install ¶
func (i *GoInstaller) Install(vsn *version.Version) error
func (*GoInstaller) InstallAsk ¶
func (i *GoInstaller) InstallAsk(installed, required, latest *version.Version) (bool, error)
func (*GoInstaller) Path ¶
func (i *GoInstaller) Path() string
type Installer ¶
type Installer interface { // InstallAsk should ask the user if they'd like to install the // project. This is only called if installation is actually required. InstallAsk(installed, required, latest *version.Version) (bool, error) // Install should install the specified version. Install(*version.Version) error // Path is the path to the installed main binary of this project, // or "" if it doesn't seem installed. Path() string }
Installer is the interface that knows how to install things.
This is an interface to support different installation methods between our different projects.
type Project ¶
type Project struct { // Name is the name of the project, all lowercase Name string // Installer is the installer for this project Installer Installer // MinVersion is the minimum version of this project that Otto // can use to function. This will be used with `InstallIfNeeded` // to prompt the user to install. MinVersion *version.Version }
Project represents a HashiCorp Go project and provides various operations around that.
func (*Project) InstallIfNeeded ¶
InstallIfNeeded will check if installation of this project is required and will invoke the installer if needed.
func (*Project) LatestVersion ¶
Latest version returns the latest version of this project.
type VagrantInstaller ¶
type VagrantInstaller struct { // Ui is the Otto UI for asking the user for input and outputting // the status of installation. Ui ui.Ui }
VagrantInstaller is an Installer that knows how to install Vagrant, which uses its own system installer.
func (*VagrantInstaller) Install ¶
func (i *VagrantInstaller) Install(vsn *version.Version) error
func (*VagrantInstaller) InstallAsk ¶
func (i *VagrantInstaller) InstallAsk(installed, required, latest *version.Version) (bool, error)
func (*VagrantInstaller) Path ¶
func (i *VagrantInstaller) Path() string
Click to show internal directories.
Click to hide internal directories.