Documentation ¶
Index ¶
- func ChangeAgentTools(dataDir string, agentName string, vers version.Binary) (*coretools.Tools, error)
- func EnsureSymlinks(jujuDir, dir string, commands []string) (err error)
- func ReadGUIArchive(dataDir string) (*coretools.GUIArchive, error)
- func ReadTools(dataDir string, vers version.Binary) (*coretools.Tools, error)
- func SharedGUIDir(dataDir string) string
- func SharedToolsDir(dataDir string, vers version.Binary) string
- func ToolsDir(dataDir, agentName string) string
- func UnpackTools(dataDir string, tools *coretools.Tools, r io.Reader) (err error)
- func WriteToolsMetadataData(dir string, tools *coretools.Tools) error
- type DiskManager
- type ToolsManager
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 ¶
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 ¶
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 ¶
SharedGUIDir returns the directory that is used to store release archives of the Juju GUI within the dataDir directory.
func SharedToolsDir ¶
SharedToolsDir returns the directory that is used to store binaries for the given version of the juju tools within the dataDir directory.
func ToolsDir ¶
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 ¶
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) SharedToolsDir ¶
func (d *DiskManager) SharedToolsDir(vers version.Binary) string
func (*DiskManager) UnpackTools ¶
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