Documentation
¶
Index ¶
- Variables
- func Argument(gitversion string) bool
- func CloseLogger()
- func DownloadFile(url, filePath string) error
- func FindJava() (string, bool, bool)
- func Log(a ...interface{})
- func Logf(format string, a ...interface{})
- func RecordError(url string, err error, response string)
- func RunInstaller(installerPath string, loader string, version string, loaderVersion string, ...) error
- func RunScript(Version string, Loader string, LoaderVersion string, simpfun bool, mise bool, ...)
- func SetupLogger() error
- type Config
- type DownloadError
- type InstConfig
- type Library
- type ProgressReader
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LogFile *os.File DownloadErrors []DownloadError ErrorMutex sync.Mutex )
Functions ¶
func CloseLogger ¶ added in v1.4.0
func CloseLogger()
func DownloadFile ¶
func RecordError ¶ added in v1.4.0
func RunInstaller ¶
func SetupLogger ¶ added in v1.4.0
func SetupLogger() error
Types ¶
type DownloadError ¶ added in v1.4.0
type InstConfig ¶
type InstConfig struct {
Version string `json:"version"`
Loader string `json:"loader"`
LoaderVersion string `json:"loaderVersion"`
Download string `json:"download"`
MaxConnections int `json:"maxconnections"`
Argsment string `json:"argsment"`
}
InstConfig 结构体表示 inst.json 的内容
type Library ¶
type Library struct {
Name string `json:"name"`
Downloads struct {
Artifact struct {
URL string `json:"url"`
Path string `json:"path"`
SHA1 string `json:"sha1"`
} `json:"artifact"`
} `json:"downloads"`
}
Library 定义库的结构
type ProgressReader ¶
type ProgressReader struct {
Reader io.ReadCloser
Total int64
Current int64
FilePath string
UpdateInterval int64 // 更新间隔,单位秒
// contains filtered or unexported fields
}
ProgressReader 用于跟踪 io.Reader 的进度
type VersionInfo ¶
type VersionInfo struct {
Libraries []Library `json:"libraries"`
}
VersionInfo 定义 version.json 文件的结构
func ExtractVersionJson ¶
func ExtractVersionJson(jarFilePath string) (VersionInfo, error)
从 JAR 文件中提取 version.json
Click to show internal directories.
Click to hide internal directories.