tools

package
v0.0.0-...-732aecd Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2014 License: AGPL-3.0 Imports: 14 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 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 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.

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