constants

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Windows 系统环境变量路径
	ENV_SYSTEM_PATH = `SYSTEM\CurrentControlSet\Control\Session Manager\Environment`
	ENV_USER_PATH   = `Environment`

	// 默认配置路径
	DEFAULT_CONFIG_FILE = "config.json"
	DEFAULT_FOLDER      = ".sdks"
	DEFAULT_BACKUP_FILE = "backup.json"

	// sdk type
	JAVA_SDK   = "java"
	MAVEN_SDK  = "maven"
	NODE_SDK   = "node"
	GO_SDK     = "go"
	PYTHON_SDK = "python"
	PHP_SDK    = "php"
)

Variables

View Source
var (
	SdkType     = JAVA_SDK
	SymlinkPath = ""

	Sdks = map[string]SdkInfo{
		JAVA_SDK:   {Name: JAVA_SDK, Home: "JAVA_HOME", ExecName: map[string][]string{"windows": {filepath.Join("bin", "javac.exe")}, "linux": {filepath.Join("bin", "javac")}, "darwin": {filepath.Join("bin", "javac")}}},
		MAVEN_SDK:  {Name: MAVEN_SDK, Home: "MAVEN_HOME", ExecName: map[string][]string{"windows": {filepath.Join("bin", "mvn.cmd"), filepath.Join("bin", "mvnd.cmd")}, "linux": {filepath.Join("bin", "mvn"), filepath.Join("bin", "mvnd")}, "darwin": {filepath.Join("bin", "mvn"), filepath.Join("bin", "mvnd")}}},
		NODE_SDK:   {Name: NODE_SDK, Home: "NODE_HOME", ExecName: map[string][]string{"windows": {filepath.Join("node.exe")}, "linux": {filepath.Join("bin", "node")}, "darwin": {filepath.Join("bin", "node")}}},
		GO_SDK:     {Name: GO_SDK, Home: "GO_HOME", ExecName: map[string][]string{"windows": {filepath.Join("bin", "go.exe")}, "linux": {filepath.Join("bin", "go")}, "darwin": {filepath.Join("bin", "go")}}},
		PYTHON_SDK: {Name: PYTHON_SDK, Home: "PYTHON_HOME", ExecName: map[string][]string{"windows": {filepath.Join("python.exe")}, "linux": {filepath.Join("python")}, "darwin": {filepath.Join("python")}}},
		PHP_SDK:    {Name: PHP_SDK, Home: "PHP_HOME", ExecName: map[string][]string{"windows": {filepath.Join("php.exe")}, "linux": {filepath.Join("php")}, "darwin": {filepath.Join("php")}}},
	}
)

Functions

func CheckSdkType

func CheckSdkType(sdkType string) bool

func GetDefaultEnvHome

func GetDefaultEnvHome(sdkType string) string

func GetDefaultSymlinkPath

func GetDefaultSymlinkPath(sdkType string) string

func GetEnvHome

func GetEnvHome(sdkType string) string

func GetSDKName added in v1.0.9

func GetSDKName(sdkType string) string

Types

type SdkInfo added in v1.2.5

type SdkInfo struct {
	Name     string
	Home     string
	ExecName map[string][]string
}

Jump to

Keyboard shortcuts

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