tools

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeAgentTools

func ChangeAgentTools(dataDir string, agentName string, vers version.Binary) (*coretools.Tools, error)

ChangeAgentTools atomically replaces the agent-specific symlink under dataDir so it points to the previously unpacked version vers. It returns the new tools read.

func EnsureSymlinks(jujuDir, dir string, commands []string) (err error)

EnsureSymlinks creates a symbolic link to jujud within dir for each command. If the commands already exist, this operation does nothing. If dir is a symbolic link, it will be dereferenced first.

func ReadGUIArchive

func ReadGUIArchive(dataDir string) (*coretools.GUIArchive, error)

ReadGUIArchive reads the GUI information from the dataDir directory. The GUI information is JSON encoded in a text file, "downloaded-gui.txt".

func ReadTools

func ReadTools(dataDir string, vers version.Binary) (*coretools.Tools, error)

ReadTools checks that the tools information for the given version exists in the dataDir directory, and returns a Tools instance. The tools information is json encoded in a text file, "downloaded-tools.txt".

func SharedGUIDir

func SharedGUIDir(dataDir string) string

SharedGUIDir returns the directory that is used to store release archives of the Juju GUI within the dataDir directory.

func SharedToolsDir

func SharedToolsDir(dataDir string, vers version.Binary) string

SharedToolsDir returns the directory that is used to store binaries for the given version of the juju tools within the dataDir directory.

func ToolsDir

func ToolsDir(dataDir, agentName string) string

ToolsDir returns the directory that is used/ to store binaries for the tools used by the given agent within the given dataDir directory. Conventionally it is a symbolic link to the actual tools directory.

func UnpackTools

func UnpackTools(dataDir string, tools *coretools.Tools, r io.Reader) (err error)

UnpackTools reads a set of juju tools in gzipped tar-archive format and unpacks them into the appropriate tools directory within dataDir. If a valid tools directory already exists, UnpackTools returns without error.

func WriteToolsMetadataData

func WriteToolsMetadataData(dir string, tools *coretools.Tools) error

WriteToolsMetadataData writes the tools metadata file to the given directory.

Types

type DiskManager

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

DiskManager keeps track of a collections of Juju agent tools in a directory structure on disk.

func NewDiskManager

func NewDiskManager(dataDir string) *DiskManager

NewDiskManager returns a DiskManager handling a given directory. *DiskManager conforms to the ToolsManager interface

func (*DiskManager) ReadTools

func (d *DiskManager) ReadTools(vers version.Binary) (*tools.Tools, error)

func (*DiskManager) SharedToolsDir

func (d *DiskManager) SharedToolsDir(vers version.Binary) string

func (*DiskManager) UnpackTools

func (d *DiskManager) UnpackTools(tools *tools.Tools, r io.Reader) error

type ToolsManager

type ToolsManager interface {

	// ReadTools looks in the current storage to see what tools are
	// available that match the given Binary version.
	ReadTools(version version.Binary) (*tools.Tools, error)

	// UnpackTools reads the compressed tarball from the io.Reader and
	// extracts the tools to be used. tools is used to indicate what exact
	// version are in the contents of the tarball
	UnpackTools(tools *tools.Tools, r io.Reader) error
}

ToolsManager keeps track of a pool of tools

Jump to

Keyboard shortcuts

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