version

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultURL defines the default Forge version URL.
	DefaultURL = "https://files.minecraftforge.net/net/minecraftforge/forge/maven-metadata.json"
)

Variables

View Source
var (
	// OldestMinecraft defines the oldest allowed Minecraft version.
	OldestMinecraft = "1.6.4"

	// DownloadHomepage defines the download base url to fetch installer.
	DownloadHomepage = "https://maven.minecraftforge.net/net/minecraftforge/forge"
)

Functions

This section is empty.

Types

type ByMinecraft added in v0.2.0

type ByMinecraft Versions

ByMinecraft sorts a list of Forge versions by ID.

func (ByMinecraft) Len added in v0.2.0

func (b ByMinecraft) Len() int

Len is part of the sorting algorithm.

func (ByMinecraft) Less added in v0.2.0

func (b ByMinecraft) Less(i, j int) bool

Less is part of the sorting algorithm.

func (ByMinecraft) Sort added in v0.2.0

func (b ByMinecraft) Sort()

Sort simply sorts the versions list.

func (ByMinecraft) Swap added in v0.2.0

func (b ByMinecraft) Swap(i, j int)

Swap is part of the sorting algorithm.

type ByVersion added in v0.2.0

type ByVersion Versions

ByVersion sorts a list of Forge versions by ID.

func (ByVersion) Len added in v0.2.0

func (b ByVersion) Len() int

Len is part of the sorting algorithm.

func (ByVersion) Less added in v0.2.0

func (b ByVersion) Less(i, j int) bool

Less is part of the sorting algorithm.

func (ByVersion) Sort added in v0.2.0

func (b ByVersion) Sort()

Sort simply sorts the versions list.

func (ByVersion) Swap added in v0.2.0

func (b ByVersion) Swap(i, j int)

Swap is part of the sorting algorithm.

type Filter

type Filter struct {
	Version   string
	Minecraft string
}

Filter defines filter attributes for Versions.

type Response

type Response struct {
	Releases Versions `json:"releases"`
}

Response is the standard root element for the version list.

func FromDefault

func FromDefault() (Response, error)

FromDefault is a simply wrapper that loads the default URL.

func FromPath

func FromPath(path string) (Response, error)

FromPath parses a version definition from file path.

func FromString

func FromString(content []byte) (Response, error)

FromString parses a version definition from string.

func FromURL

func FromURL(path string) (Response, error)

FromURL parses a version definition from URL.

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the custom JSON unmarshaler.

type Version

type Version struct {
	ID        string `json:"id"`
	Minecraft string `json:"minecraft"`
	URL       string `json:"url"`
}

Version defines the standard version format.

type Versions

type Versions []Version

Versions is simply a collection of Version.

func (Versions) Filter

func (v Versions) Filter(filter *Filter) Versions

Filter reduces the list of Versions by given criteria.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL