env

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

View Source
var EmptyRecord = &empty{}

Functions

func GetOrigPath

func GetOrigPath() string

func IsHookEnv

func IsHookEnv() bool

func IsRecordExist

func IsRecordExist(dirPath string) bool

Types

type Envs

type Envs map[string]*string

type KV

type KV struct {
	Key   string
	Value string
}

type Manager

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

func NewEnvManager

func NewEnvManager(vfConfigPath string) (Manager, error)

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 Store

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

func NewStore

func NewStore() *Store

func (*Store) Add

func (s *Store) Add(kv *KV)

func (*Store) Remove

func (s *Store) Remove(key string)

Jump to

Keyboard shortcuts

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