env

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFs

func GetFs() afero.Fs

GetFs gets the default afero.Fs

func IsMemMapFs

func IsMemMapFs(f afero.Fs) bool

IsMemMapFs returns true if the afero.Fs is of type *afero.MemMapFs

func IsOsFs

func IsOsFs(f afero.Fs) bool

IsOsFs returns true if the afero.Fs is of type *afero.OsFs

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.

func SetFs

func SetFs(_fs afero.Fs)

SetFs sets the default afero.Fs

Types

type Factory

type Factory interface {
	RuntimeInfo() system.RuntimeInfo

	// NewBuilder returns an object that assists in loading objects from both disk and the server
	// and which implements the common patterns for CLI interactions with generic resources.
	NewBuilder() *util.Builder

	Logger() log.Logger

	Pather() devctlpath.Pather

	Paths() Paths

	Fs() afero.Fs

	Streams() options.IOStreams

	// Returns a schema that can validate objects stored on disk.
	Validator(validate bool) (validation.Schema, error)
}

Factory provides abstractions that allow the Devctl command to be extended across multiple types of resources and different API sets.

func NewFactory

func NewFactory(opts ...FactoryOption) Factory

type FactoryConfig

type FactoryConfig struct {
	Pather            devctlpath.Pather
	Paths             Paths
	LoggerConfig      *log.Config
	Streams           *options.IOStreams
	RuntimeInfoGetter system.RuntimeInfoGetter
	Fs                afero.Fs
}

type FactoryOption

type FactoryOption func(*FactoryConfig) *FactoryConfig

func WithIO

func WithIO(in io.Reader, out, err io.Writer) FactoryOption

type Paths

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

func MustGetPaths

func MustGetPaths() Paths

MustGetPaths returns the inferred paths for devctl. By default, it assumes $HOME/.devctl as the base path, but can be overridden via DEVCTL_ROOT environment variable.

func NewPaths

func NewPaths(base string) Paths

func (Paths) Base

func (p Paths) Base() string

Base returns the devctl 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. {BasePath}/bin

func (Paths) IndexBase

func (p Paths) IndexBase() string

IndexBase returns the devctl index directory

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) IndexPluginManifestPath

func (p Paths) IndexPluginManifestPath(indexName, pluginName string) string

IndexPluginManifestPath returns the plugins directory of an index repository.

e.g. {BasePath}/index/default/plugins/ or {BasePath}/index/plugins/

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 install 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}

Jump to

Keyboard shortcuts

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