root

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDir added in v0.0.29

func DefaultDir() string

DefaultDir derives the default Thelma root directory. It will be: * The value of the THELMA_ROOT env var, if set * If a valid home directory exists for current user, it will be $HOME/.thelma * Else, /tmp/.thelma.<pid> (worst-case fallback option in weird environments) Note that this function identifies the root directory path, but does NOT create the root directory; it may or may not exist.

Types

type ReleasesDir added in v1.0.37

type ReleasesDir interface {
	// Root return path of root of releases dir (~/.thelma/releases)
	Root() string
	// CurrentSymlink return path of current release symlink (~/.thelma/releases/current)
	CurrentSymlink() string
	// ForVersion return path of release dir for specific version (~/.thelma/releases/v1.2.3)
	ForVersion(version string) string
	// ForCurrentVersion return path of release dir for current running thelma version (~/.thelma/releases/v1.2.3)
	ForCurrentVersion() string
}

type Root added in v0.0.29

type Root interface {
	// Dir returns the Thelma installation root directory, usually ~/.thelma
	Dir() string
	// LogDir returns the path where Thelma debug logs are stored ($ROOT/logs)
	LogDir() string
	// CachesDir returns the Thelma cache directory ($ROOT/caches)
	CachesDir() string
	// CredentialsDir returns the path to Thelma credentials directory ($ROOT/credentials)
	CredentialsDir() string
	// ConfigDir returns the path to Thelma config directory
	ConfigDir() string
	// ReleasesDir returns the Thelma installation directory ($ROOT/releases)
	ReleasesDir() ReleasesDir
	// ToolsDir returns the path to Thelma's bundled third-party tool binaries, such as Helm, Helmfile, etc.
	ToolsDir() (ToolsDir, error)
	// CreateDirectories create directories if they do not exist. Will be called as part of Thelma initialization
	CreateDirectories() error
}

func Default added in v0.0.29

func Default() Root

Default returns a Root instance rooted at the default directory returned by DefaultDir

func New added in v0.0.29

func New(dir string) Root

New (FOR TESTING ONLY) returns a Root instance rooted at the given directory

type ToolsDir added in v1.0.37

type ToolsDir interface {
	// Bin subdir within tools dir that includes tool binaries
	Bin() string
}

ToolsDir path on disk where Thelma's bundled tools, such as `kubectl`, `helm`, etc live

Jump to

Keyboard shortcuts

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