env

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookFlag = "__VFOX_SHELL"
	PathFlag = "__VFOX_ORIG_PATH"
	PidFlag  = "__VFOX_PID"
)

Variables

View Source
var EmptyRecord = &empty{}

Functions

func GetOrigPath

func GetOrigPath() string

func GetPid added in v0.2.5

func GetPid() int

func IsHookEnv

func IsHookEnv() bool

func IsRecordExist

func IsRecordExist(dirPath string) bool

Types

type Envs

type Envs struct {
	Variables Vars
	Paths     Paths
}

Envs is a struct that contains environment variables and PATH.

type Manager

type Manager interface {
	Flush() error
	Load(envs *Envs) error
	Get(key string) (string, bool)
	Remove(envs *Envs) error
	Paths(paths []string) string
	io.Closer
}

func NewEnvManager

func NewEnvManager(vfConfigPath string) (Manager, error)

type Paths added in v0.2.5

type Paths []string

Paths is a slice of PATH.

type Record

type Record interface {
	Add(name, version string)
	Remove(name string)
	Export() map[string]string
	Save() error
}

Record is an interface to record tool version

func NewRecord

func NewRecord(mainPath string, salve ...string) (Record, error)

type Scope

type Scope int
const (
	Global Scope = iota
	Local
)

type Vars added in v0.2.5

type Vars map[string]*string

Vars is a map of environment variables

Jump to

Keyboard shortcuts

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