Documentation
¶
Index ¶
- Variables
- func LatestRelease() (*structure.PistonMetaVersionData, error)
- func LatestSnapshot() (*structure.PistonMetaVersionData, error)
- func ListVersions() ([]*structure.PistonMetaVersionData, error)
- func Request(url string) (io.ReadCloser, error)
- func Version(id *structure.PistonMetaId) (*structure.PistonMetaVersionData, error)
- func VersionPackage(id *structure.PistonMetaId) (*structure.PistonMetaPackage, error)
- type MCVersionLatest
- type MCVersions
- func (mcv *MCVersions) Fetch() error
- func (mcv *MCVersions) GetVersion(id *structure.PistonMetaId) (*structure.PistonMetaVersionData, error)
- func (mcv *MCVersions) GetVersionPackage(id *structure.PistonMetaId) (*structure.PistonMetaPackage, error)
- func (mcv *MCVersions) Grab() error
- func (mcv *MCVersions) LatestRelease() (_ *structure.PistonMetaVersionData, err error)
- func (mcv *MCVersions) LatestSnapshot() (_ *structure.PistonMetaVersionData, err error)
- func (mcv *MCVersions) ListVersions() ([]*structure.PistonMetaVersionData, error)
- func (mcv *MCVersions) Load() error
Constants ¶
This section is empty.
Variables ¶
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 ¶
func Version(id *structure.PistonMetaId) (*structure.PistonMetaVersionData, error)
Version is a utility function to get version download information using the specific ID
func VersionPackage ¶
func VersionPackage(id *structure.PistonMetaId) (*structure.PistonMetaPackage, error)
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 ¶
func (mcv *MCVersions) GetVersion(id *structure.PistonMetaId) (*structure.PistonMetaVersionData, error)
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