Merge remote-tracking branch 'origin/main'

# Conflicts:
#	domain/domain.go
#	domain/minecraftgame.go
#	domain/steamgame.go
#	domain/structures.go
This commit is contained in:
cyber-dream 2023-02-12 19:44:17 +03:00
commit 605da815cd
2 changed files with 108 additions and 0 deletions

105
domain/structures.go Normal file
View File

@ -0,0 +1,105 @@
package minecraftgame
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"`
}
type VersionNums struct {
Major string `json:"major"`
Minor string `json:"minor"`
Patch string `json:"patch"`
}
type Version struct {
AssetIndex AssetIndex `json:"assetIndex"`
Downloads struct {
Client Artifact `json:"client"`
Server Artifact `json:"server"`
Mods struct {
Required []ModArtifact `json:"required"`
} `json:"mods"`
} `json:"downloads"`
ID string `json:"id"`
Libraries []Lib `json:"libraries"`
//ClientLog LogCfg
MainClass string `json:"mainClass"`
GameArgs []Argument
JVMArgs []Argument
Type string `json:"type"`
}
type AssetIndex struct {
ID string `json:"id"`
TotalSize uint64 `json:"totalSize"`
Artifact
}
type Argument struct {
Value string `json:"value"`
Rules []Rule `json:"rules"`
}
type Rule struct {
Action RuleAct `json:"action" mapstructure:"action"`
// OS information. All fields are regexes.
OS struct {
Name string `json:"name" mapstructure:"name"`
Version string `json:"version" mapstructure:"version"`
Arch string `json:"arch" mapstructure:"arch"`
} `json:"os" mapstructure:"os"`
Features struct {
IsDemoUser *bool `json:"is_demo_user" mapstructure:"is_demo_user"`
HasCustomResolution *bool `json:"has_custom_resolution" mapstructure:"has_custom_resolution"`
} `json:"features" mapstructure:"features"`
}
type RuleAct string
const (
ActAllow RuleAct = "allow"
ActDisallow RuleAct = "disallow"
)
type LibClassifiers struct {
JavaDoc *Artifact `json:"javadoc"`
NativesLinux *Artifact `json:"natives-linux"`
NativesMacOS *Artifact `json:"natives-osx"`
NativesWin *Artifact `json:"natives-windows"`
Sources *Artifact `json:"sources"`
}
type Lib struct {
Downloads struct {
MainJar *Artifact `json:"artifact"`
LibClassifiers `json:"classifiers"`
} `json:"downloads"`
NativeSuffixes struct {
Linux string `json:"linux"`
MacOS string `json:"osx"`
Windows string `json:"windows"`
} `json:"natives"`
Name string `json:"name"`
Rules []Rule `json:"rules"`
ExtractRules struct {
Exclude []string `json:"exclude"`
} `json:"extract"`
}
type Artifact struct {
SHA1 string `json:"sha1"`
Size uint64 `json:"size"`
URL string `json:"url"`
}
type ModArtifact struct {
Artifact
File string
Name string
Version string
}

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module git.gregbrzezinski.com/Skirda/sharedutils
go 1.18