juju: github.com/juju/juju/agent/tools Index | Files

package tools

import "github.com/juju/juju/agent/tools"


Package Files

diskmanager.go symlinks.go tools.go toolsdir.go

func ChangeAgentTools Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

WriteToolsMetadataData writes the tools metadata file to the given directory.

type DiskManager Uses

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 Uses

func NewDiskManager(dataDir string) *DiskManager

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

func (*DiskManager) ReadTools Uses

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

func (*DiskManager) SharedToolsDir Uses

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

func (*DiskManager) UnpackTools Uses

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

type ToolsManager Uses

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

Package tools imports 17 packages (graph) and is imported by 420 packages. Updated 2020-04-25. Refresh now. Tools for package owners.