Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
Types ¶
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"`
}
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.