internal

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestMode = false

Functions

func AddCmd

func AddCmd(cmdName string, gc GlobalConfig) *cobra.Command

func AddProfileCmd added in v1.0.14

func AddProfileCmd(gc GlobalConfig) *cobra.Command

func ConfigDir

func ConfigDir() string

func ConfigDirPath

func ConfigDirPath() string

func DoctorCmd added in v1.0.16

func DoctorCmd(gc GlobalConfig) *cobra.Command

func ExitWithMsg added in v1.0.13

func ExitWithMsg(code int, msg string)

func FullStatusCmd

func FullStatusCmd(gc GlobalConfig) *cobra.Command

func GlobalConfigPath

func GlobalConfigPath() string

func HomeDir

func HomeDir() string

func LegacyConfigDirPath

func LegacyConfigDirPath() string

func ListProfilesCmd

func ListProfilesCmd(cmdName string, gc GlobalConfig) *cobra.Command

func MigrateConfigDir

func MigrateConfigDir(gc GlobalConfig) *cobra.Command

func PrettyJson

func PrettyJson[T any](t T) string

func RemoveCmd

func RemoveCmd(cmdName string, gc GlobalConfig) *cobra.Command

func RemoveProfileCmd added in v1.0.14

func RemoveProfileCmd(gc GlobalConfig) *cobra.Command

func ResetCmd

func ResetCmd(gc GlobalConfig) *cobra.Command

func SaveGlobalConfRaw

func SaveGlobalConfRaw(gcr GlobalConfigRaw)

func SetCmd

func SetCmd(gc GlobalConfig) *cobra.Command

func StatusCmd

func StatusCmd(gc GlobalConfig) *cobra.Command

func StatusProfileCmd

func StatusProfileCmd(gc GlobalConfig) *cobra.Command

func StatusRawCmd

func StatusRawCmd(gc GlobalConfig) *cobra.Command

Types

type DetectedProfile

type DetectedProfile struct {
	Name string
	Path string
}

type GlobalConfig

type GlobalConfig struct {
	Paths []Path
}

func LoadGlobalConf

func LoadGlobalConf() GlobalConfig

func (GlobalConfig) ActiveProfileNames

func (g GlobalConfig) ActiveProfileNames() []string

func (GlobalConfig) AllProfilesResolved

func (g GlobalConfig) AllProfilesResolved() bool

func (GlobalConfig) DetectedProfileNames

func (g GlobalConfig) DetectedProfileNames() []string

type GlobalConfigRaw

type GlobalConfigRaw struct {
	Paths []string `json:"paths"`
}

func LoadGlobalConfRaw

func LoadGlobalConfRaw() GlobalConfigRaw

type Path

type Path struct {
	SrcPath       string            `json:"srcPath"`
	Status        Status            `json:"status"`
	TgtPath       *string           `json:"tgtPath"`
	ResolvedTgt   *DetectedProfile  `json:"resolvedTgt"`
	DetectedProfs []DetectedProfile `json:"detectedProfs"`
}

func (*Path) ActiveProfile added in v1.0.16

func (path *Path) ActiveProfile() (string, error)

func (*Path) ProfsDir added in v1.0.14

func (path *Path) ProfsDir() (string, error)

type Status

type Status string
const (
	StatusOk                   Status = "ok"
	StatusErrorSrcNotFound     Status = "error_src_not_found"
	StatusErrorTgtNotFound     Status = "error_tgt_not_found"
	StatusErrorSrcNotSymlink   Status = "error_tgt_not_prof"
	StatusErrorTgtUnresolvable Status = "error_tgt_not_resolvable"
)

Jump to

Keyboard shortcuts

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