environment

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Realpath

func Realpath(path string) (string, error)

Realpath evaluates symbolic links. If the path is not a symbolic link, it returns the cleaned path. Symbolic links with relative paths return error.

Types

type Environment

type Environment interface {
	BasePath() string
	IndexBase() string
	IndexPath(name string) string
	IndexPluginsPath(name string) string
	InstallReceiptsPath() string
	BinPath() string
	InstallPath() string
	PluginInstallPath(plugin string) string
	PluginInstallReceiptPath(plugin string) string
	PluginVersionInstallPath(plugin, version string) string
}

type Paths

type Paths struct {
	// contains filtered or unexported fields
}

Paths contains all important environment paths

func MustGetApmPaths

func MustGetApmPaths(log log.Logger) Paths

MustGetApmPaths returns the inferred paths for apm. By default, it assumes $HOME/.ankor as the base path, but can be overridden via APM_ROOT environment variable.

func NewPaths

func NewPaths(base string) Paths

func (Paths) BasePath

func (p Paths) BasePath() string

BasePath returns apm base directory.

func (Paths) BinPath

func (p Paths) BinPath() string

BinPath returns the path where plugin executable symbolic links are found. This path should be added to $PATH in client machine.

e.g. {HOME}/.local/bin

func (Paths) IndexBase

func (p Paths) IndexBase() string

IndexBase returns the apm index directory. This directory contains the default index and custom ones.

func (Paths) IndexPath

func (p Paths) IndexPath(name string) string

IndexPath returns the directory where a plugin index repository is cloned. e.g. {BasePath}/index/default or {BasePath}/index

func (Paths) IndexPluginsPath

func (p Paths) IndexPluginsPath(name string) string

IndexPluginsPath returns the plugins directory of an index repository. e.g. {BasePath}/index/default/plugins/ or {BasePath}/index/plugins/

func (Paths) InstallPath

func (p Paths) InstallPath() string

InstallPath returns the base directory for plugin installations.

e.g. {BasePath}/store

func (Paths) InstallReceiptsPath

func (p Paths) InstallReceiptsPath() string

InstallReceiptsPath returns the base directory where plugin receipts are stored.

e.g. {BasePath}/receipts

func (Paths) PluginInstallPath

func (p Paths) PluginInstallPath(plugin string) string

PluginInstallPath returns the path to install the plugin.

e.g. {InstallPath}/{version}/{..files..}

func (Paths) PluginInstallReceiptPath

func (p Paths) PluginInstallReceiptPath(plugin string) string

PluginInstallReceiptPath returns the path to the installation receipt for plugin.

e.g. {InstallReceiptsPath}/{plugin}.yaml

func (Paths) PluginVersionInstallPath

func (p Paths) PluginVersionInstallPath(plugin, version string) string

PluginVersionInstallPath returns the path to the specified version of specified plugin. e.g. {PluginInstallPath}/{plugin}/{version}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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