env

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendHistory

func AppendHistory(envName, command string) error

func BasePath

func BasePath() (string, error)

func Clear

func Clear(name string, keepHistory bool) error

func Create

func Create(name string) error

func Delete

func Delete(name string) error

func EnsureBaseStructure

func EnsureBaseStructure() error

func EnsureDefaultEnvironment

func EnsureDefaultEnvironment() error

func EnvsPath

func EnvsPath() (string, error)

func Exists

func Exists(name string) bool

func Export

func Export(name, outputPath string) error

func GlobalConfigPath

func GlobalConfigPath() (string, error)

func Import

func Import(inputPath, targetName string, force bool) (string, error)

func Open

func Open(name string) (string, error)

func ReadHistory

func ReadHistory(envName string) ([]string, error)

func Rename

func Rename(oldName, newName string) error

func ResolveEnvPath

func ResolveEnvPath(name string) (string, error)

func RestoreVariables

func RestoreVariables(envName string) (map[string]any, error)

func SaveGlobalConfig

func SaveGlobalConfig(cfg GlobalConfig) error

func SaveState

func SaveState(envName string, vars map[string]any) error

Types

type EnvironmentInfo

type EnvironmentInfo struct {
	Name          string
	Path          string
	LastAccess    time.Time
	VariableCount int
}

func Info

func Info(name string) (EnvironmentInfo, error)

func List

func List() ([]EnvironmentInfo, error)

type ExportPayload

type ExportPayload struct {
	SchemaVersion int             `json:"schemaVersion"`
	ExportedAt    string          `json:"exportedAt"`
	Environment   string          `json:"environment"`
	State         *State          `json:"state"`
	History       []string        `json:"history"`
	Config        json.RawMessage `json:"config"`
}

type GlobalConfig

type GlobalConfig struct {
	DefaultEnv string `json:"defaultEnv"`
	LogLevel   string `json:"logLevel"`
	NoColor    bool   `json:"noColor"`
}

func LoadGlobalConfig

func LoadGlobalConfig() (GlobalConfig, error)

func UpdateGlobalConfig

func UpdateGlobalConfig(key, value string) (GlobalConfig, error)

type SerializedVariable

type SerializedVariable struct {
	Type string `json:"type"`
	Name string `json:"name,omitempty"`
	Data any    `json:"data"`
}

type State

type State struct {
	Variables  map[string]SerializedVariable `json:"variables"`
	LastAccess string                        `json:"lastAccess"`
}

func LoadState

func LoadState(envName string) (*State, error)

Jump to

Keyboard shortcuts

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