add method find OsSpecifics to java versions
This commit is contained in:
parent
0dce90931c
commit
2b95a109c6
@ -2,12 +2,23 @@ package domain
|
||||
|
||||
type JavaVersion struct {
|
||||
VersionNums `json:"version"`
|
||||
Specifics []struct {
|
||||
Os string `json:"os"`
|
||||
Arch string `json:"arch"`
|
||||
URL string `json:"URL"`
|
||||
Sha1 string `json:"SHA1"`
|
||||
} `json:"specifics"`
|
||||
Specifics []JavaVersionSpecifics `json:"specifics"`
|
||||
}
|
||||
|
||||
type JavaVersionSpecifics struct {
|
||||
Os string `json:"os"`
|
||||
Arch string `json:"arch"`
|
||||
URL string `json:"URL"`
|
||||
Sha1 string `json:"SHA1"`
|
||||
}
|
||||
|
||||
func (jv *JavaVersion) FindOs(os string, arch string) *JavaVersionSpecifics {
|
||||
for _, s := range jv.Specifics {
|
||||
if s.Os == os && s.Arch == arch {
|
||||
return &s
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type VersionNums struct {
|
||||
@ -28,10 +39,11 @@ type Version struct {
|
||||
ID string `json:"id"`
|
||||
Libraries []Lib `json:"libraries"`
|
||||
//ClientLog LogCfg
|
||||
MainClass string `json:"mainClass"`
|
||||
GameArgs []Argument
|
||||
JVMArgs []Argument
|
||||
Type string `json:"type"`
|
||||
MainClass string `json:"mainClass"`
|
||||
GameArgs []Argument
|
||||
JVMArgs []Argument
|
||||
Type string `json:"type"`
|
||||
JavaVersion JavaVersion `json:"javaVersion"`
|
||||
}
|
||||
|
||||
type AssetIndex struct {
|
||||
@ -45,6 +57,11 @@ type AssetIndex struct {
|
||||
// Rules []Rule `json:"rules"`
|
||||
// }
|
||||
|
||||
type JavaVersionClientDistribution struct { //TODO Rename
|
||||
Component string `json:"component"`
|
||||
MajorVersion int `json:"majorVersion"`
|
||||
}
|
||||
|
||||
type Rule struct {
|
||||
Action RuleAct `json:"action" mapstructure:"action"`
|
||||
// OS information. All fields are regexes.
|
||||
|
Loading…
Reference in New Issue
Block a user