Documentation
¶
Index ¶
- Constants
- func FetchAsset(ctx context.Context, hc *http.Client, asset Asset) (io.ReadCloser, error)
- type Asset
- type Assets
- type Manifest
- type ManifestLatest
- type ManifestVersion
- type Version
- type VersionArgument
- type VersionArgumentValue
- type VersionArguments
- type VersionAssetIndex
- type VersionDownload
- type VersionJavaVersion
- type VersionLibrary
- type VersionLibraryDownload
- type VersionLibraryDownloads
- type VersionLibraryExtract
- type VersionLogging
- type VersionLoggingFile
- type VersionRule
- type VersionRuleOS
Constants ¶
View Source
const (
MANIFEST_URL = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"
)
Variables ¶
This section is empty.
Functions ¶
func FetchAsset ¶
Types ¶
type Assets ¶
func FetchAssets ¶
type Manifest ¶
type Manifest struct {
Latest ManifestLatest `json:"latest"`
Versions []ManifestVersion `json:"versions"`
}
func (*Manifest) GetLatestRelease ¶
func (m *Manifest) GetLatestRelease() (*ManifestVersion, bool)
func (*Manifest) GetVersion ¶
func (manifest *Manifest) GetVersion(id string) (*ManifestVersion, bool)
type ManifestLatest ¶
type ManifestVersion ¶
type Version ¶
type Version struct {
Arguments *VersionArguments `json:"arguments"`
AssetIndex VersionAssetIndex `json:"assetIndex"`
Assets string `json:"assets"`
ComplianceLevel int `json:"complianceLevel"`
Downloads map[string]VersionDownload `json:"downloads"`
Id string `json:"id"`
JavaVersion *VersionJavaVersion `json:"javaVersion"`
Libraries []VersionLibrary `json:"libraries"`
Logging map[string]VersionLogging `json:"logging"`
MainClass string `json:"mainClass"`
MinecraftArguments *string `json:"minecraftArguments"` // legacy
MinimumLauncherVersion int `json:"minimumLauncherVersion"`
ReleaseTime time.Time `json:"releaseTime"`
Time time.Time `json:"time"`
Type string `json:"type"`
}
func FetchVersion ¶
type VersionArgument ¶
type VersionArgument struct {
Rules []VersionRule `json:"rules"`
Value VersionArgumentValue `json:"value"`
}
func (*VersionArgument) IsEnabled ¶
func (arg *VersionArgument) IsEnabled(goos string, features []string) bool
func (*VersionArgument) UnmarshalJSON ¶
func (arg *VersionArgument) UnmarshalJSON(data []byte) error
type VersionArgumentValue ¶
type VersionArgumentValue []string
func (*VersionArgumentValue) UnmarshalJSON ¶
func (value *VersionArgumentValue) UnmarshalJSON(data []byte) error
type VersionArguments ¶
type VersionArguments struct {
Game []VersionArgument `json:"game"`
Jvm []VersionArgument `json:"jvm"`
}
type VersionAssetIndex ¶
type VersionDownload ¶
type VersionJavaVersion ¶
type VersionLibrary ¶
type VersionLibrary struct {
Downloads VersionLibraryDownloads `json:"downloads"`
Extract *VersionLibraryExtract `json:"extract"` // legacy
Name string `json:"name"`
Natives map[string]string `json:"natives"` // legacy
Rules []VersionRule `json:"rules"`
}
type VersionLibraryDownload ¶
type VersionLibraryDownloads ¶
type VersionLibraryDownloads struct {
Artifact *VersionLibraryDownload `json:"artifact"`
Classifiers map[string]VersionLibraryDownload `json:"classifiers"`
}
type VersionLibraryExtract ¶
type VersionLibraryExtract struct {
Exclude []string `json:"exclude"`
}
type VersionLogging ¶
type VersionLogging struct {
Argument string `json:"argument"`
File VersionLoggingFile `json:"file"`
Type string `json:"type"`
}
type VersionLoggingFile ¶
type VersionRule ¶
type VersionRule struct {
Action string `json:"action"`
OS *VersionRuleOS `json:"os"`
Features map[string]bool `json:"features"`
}
func (*VersionRule) MatchesRuntime ¶
func (rule *VersionRule) MatchesRuntime(goos string, features []string) bool
type VersionRuleOS ¶
type VersionRuleOS struct {
Name string `json:"name"`
Arch string `json:"arch"`
Version string `json:"version"` // regex
}
func (*VersionRuleOS) MatchesRuntime ¶
func (os *VersionRuleOS) MatchesRuntime(goos string) bool
Click to show internal directories.
Click to hide internal directories.