Documentation
¶
Overview ¶
处理各种环境
Index ¶
- Constants
- Variables
- func CheckGraia()
- type EnvSpace
- func (es *EnvSpace) CheckEnv()
- func (es *EnvSpace) CheckJava(js chan<- bool)
- func (es *EnvSpace) CheckMcl() error
- func (es *EnvSpace) CheckPython(pys chan<- bool)
- func (es *EnvSpace) DownloadJava(gwg *sync.WaitGroup, complete chan<- struct{}) error
- func (es *EnvSpace) DownloadPy(gwg *sync.WaitGroup, javacomplete <-chan struct{})
- func (es *EnvSpace) Envs() []string
- func (es *EnvSpace) FindSimEnv(name string) (SimEnv, error)
- func (es *EnvSpace) MclCommand(args []string) *exec.Cmd
- type SimEnv
Constants ¶
View Source
const ( JAVA_MIRROR = "https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/%s/%s/%s/%s/" //镜像地址,目前使用清华源,如要更换源需修改格式化代码 JAVA_VERSION = "15" //要下载的Java版本 JDK_OR_JRE = "jre" //下载JDK还是JRE,然而清华原貌似没的选(Jre也有javac) )
View Source
const ( REPOURL = "iTXTech/mirai-console-loader" MCL_ZIP = "mcl.zip" )
View Source
const ( PY_MIRROR = "https://npm.taobao.org/mirrors/python" PY_VERSION = "3.9.2" )
Variables ¶
View Source
var ARCH = map[string]string{
"amd64": "x64",
"386": "x32",
"arm64": "arm",
"arm": "arm",
}
同上
View Source
var OS = map[string]string{
"windows": "windows",
"linux": "linux",
"macos": "mac",
}
因为镜像源的目录命名和runtime.GOOS不同,所以需要映射一下
Functions ¶
func CheckGraia ¶
func CheckGraia()
Types ¶
type EnvSpace ¶
环境空间
func NewEnvSpace ¶
func NewEnvSpace() *EnvSpace
func (*EnvSpace) CheckPython ¶
func (*EnvSpace) DownloadJava ¶
func (*EnvSpace) DownloadPy ¶
func (*EnvSpace) FindSimEnv ¶ added in v0.4.2
查找指定SimEnv
type SimEnv ¶
type SimEnv struct {
Name,
ExecName,
BasePath,
ExecPath string //可执行文件所在的路径
}
单个环境
func (*SimEnv) HasDirinEnvSpace ¶
检查在环境空间中是否有单个环境的目录
func (*SimEnv) LookForExecFileinSpace ¶
在空间中查找对应可执行文件
Click to show internal directories.
Click to hide internal directories.