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 {
|
||||
Specifics []JavaVersionSpecifics `json:"specifics"`
|
||||
}
|
||||
|
||||
type JavaVersionSpecifics struct {
|
||||
Os string `json:"os"`
|
||||
Arch string `json:"arch"`
|
||||
URL string `json:"URL"`
|
||||
Sha1 string `json:"SHA1"`
|
||||
} `json:"specifics"`
|
||||
}
|
||||
|
||||
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 {
|
||||
@ -32,6 +43,7 @@ type Version struct {
|
||||
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