Documentation ¶
Index ¶
- func ChangeAgentTools(dataDir string, agentName string, vers version.Binary) (*coretools.Tools, error)
- func ReadTools(dataDir string, vers version.Binary) (*coretools.Tools, error)
- 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)
- 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 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 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