layout

package
v0.30.14 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

View Source
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

func BinaryPath(installRoot, pluginName string, majorVersion int) string

BinaryPath returns <installRoot>/plugins/<pluginName>/v<majorVersion>/<pluginName>.

func ContractFile

func ContractFile(installRoot, pluginName string) string

ContractFile returns <installRoot>/cache/contracts/<pluginName>.json.

func ContractsDir

func ContractsDir(installRoot string) string

ContractsDir returns <installRoot>/cache/contracts.

func CurrentLinkPath

func CurrentLinkPath(installRoot, pluginName string) string

CurrentLinkPath returns <installRoot>/plugins/<pluginName>/current - the symlink to the currently active binary version.

func HomeFallbackPath

func HomeFallbackPath() (string, error)

HomeFallbackPath returns ~/.deckhouse-cli - the fallback install root used when the default /opt path is not writable.

func LockPath

func LockPath(installRoot, pluginName string, majorVersion int) string

LockPath returns <installRoot>/plugins/<pluginName>/v<majorVersion>/<pluginName>.lock.

func PluginDir

func PluginDir(installRoot, pluginName string) string

PluginDir returns <installRoot>/plugins/<pluginName>.

func PluginsRoot

func PluginsRoot(installRoot string) string

PluginsRoot returns <installRoot>/plugins.

func VersionDir

func VersionDir(installRoot, pluginName string, majorVersion int) string

VersionDir returns <installRoot>/plugins/<pluginName>/v<majorVersion>.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL