mcversions

package module
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCacheMissing can usually be fixed by calling MCVersions.Grab()
	ErrCacheMissing = errors.New("cache missing")

	// ErrCacheExpired can usually be fixed by calling MCVersions.Grab()
	ErrCacheExpired = errors.New("cache expired")
)

Functions

func LatestRelease

func LatestRelease() (*structure.PistonMetaVersionData, error)

LatestRelease is a utility function to get the download information for the latest release

func LatestSnapshot

func LatestSnapshot() (*structure.PistonMetaVersionData, error)

LatestSnapshot is a utility function to get the download information for the latest snapshot

func ListVersions

func ListVersions() ([]*structure.PistonMetaVersionData, error)

ListVersions is a utility function to get the download information for all versions

func Request

func Request(url string) (io.ReadCloser, error)

Request is used for downloading json data.

func Version

Version is a utility function to get version download information using the specific ID

Types

type MCVersionLatest

type MCVersionLatest struct {
	// contains filtered or unexported fields
}

type MCVersions

type MCVersions struct {
	// contains filtered or unexported fields
}

MCVersions is the main struct for API requests.

func NewMCVersions

func NewMCVersions() (*MCVersions, error)

NewMCVersions creates an MCVersions instance.

func (*MCVersions) Fetch

func (mcv *MCVersions) Fetch() error

func (*MCVersions) GetVersion

GetVersion is used to get a version by id.

func (*MCVersions) GetVersionPackage

func (mcv *MCVersions) GetVersionPackage(id *structure.PistonMetaId) (*structure.PistonMetaPackage, error)

func (*MCVersions) Grab

func (mcv *MCVersions) Grab() error

Grab automates the load and fetch calls into a single method for use in other programs

func (*MCVersions) LatestRelease

func (mcv *MCVersions) LatestRelease() (_ *structure.PistonMetaVersionData, err error)

func (*MCVersions) LatestSnapshot

func (mcv *MCVersions) LatestSnapshot() (_ *structure.PistonMetaVersionData, err error)

func (*MCVersions) ListVersions

func (mcv *MCVersions) ListVersions() ([]*structure.PistonMetaVersionData, error)

ListVersions is used to get a list of all valid version ids.

func (*MCVersions) Load

func (mcv *MCVersions) Load() error

Directories

Path Synopsis
cmd
tui

Jump to

Keyboard shortcuts

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