Documentation
¶
Overview ¶
Package layout centralizes the on-disk filesystem layout used by the d8 plugins subsystem: directory names, suffixes, and helpers that build concrete paths from the install root.
The install root is the on-disk directory under which the subsystem keeps everything it owns - installed plugin binaries (<root>/plugins/...) and cached contracts (<root>/cache/contracts/...). It is supplied by the caller (typically pc.pluginDirectory, sourced from --plugins-dir, with default /opt/deckhouse/lib/deckhouse-cli, or ~/.deckhouse-cli as fallback).
Callers should use the builder functions (PluginDir, BinaryPath, ...) for full paths. The raw segment constants are exposed for the rare cases where only a single directory or extension name is needed.
Index ¶
- Constants
- func BinaryPath(installRoot, pluginName string, majorVersion int) string
- func ContractFile(installRoot, pluginName string) string
- func ContractsDir(installRoot string) string
- func CurrentLinkPath(installRoot, pluginName string) string
- func HomeFallbackPath() (string, error)
- func LockPath(installRoot, pluginName string, majorVersion int) string
- func PluginDir(installRoot, pluginName string) string
- func PluginsRoot(installRoot string) string
- func VersionDir(installRoot, pluginName string, majorVersion int) string
Constants ¶
const ( PluginsDirName = "plugins" CacheDirName = "cache" ContractsDirName = "contracts" CurrentLinkName = "current" LockFileSuffix = ".lock" ContractFileExt = ".json" HomeFallbackDir = ".deckhouse-cli" VersionDirPrefix = "v" )
Variables ¶
This section is empty.
Functions ¶
func BinaryPath ¶
BinaryPath returns <installRoot>/plugins/<pluginName>/v<majorVersion>/<pluginName>.
func ContractFile ¶
ContractFile returns <installRoot>/cache/contracts/<pluginName>.json.
func ContractsDir ¶
ContractsDir returns <installRoot>/cache/contracts.
func CurrentLinkPath ¶
CurrentLinkPath returns <installRoot>/plugins/<pluginName>/current - the symlink to the currently active binary version.
func HomeFallbackPath ¶
HomeFallbackPath returns ~/.deckhouse-cli - the fallback install root used when the default /opt path is not writable.
func LockPath ¶
LockPath returns <installRoot>/plugins/<pluginName>/v<majorVersion>/<pluginName>.lock.
func PluginsRoot ¶
PluginsRoot returns <installRoot>/plugins.
func VersionDir ¶
VersionDir returns <installRoot>/plugins/<pluginName>/v<majorVersion>.
Types ¶
This section is empty.