get

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package get provides functionality for getting mods and their files based on user input.

Copyright © 2021 Matthew Champagne <mmchamp95@gmail.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllMods

func AllMods(version string) ([]mcf.Mod, error)

AllMods returns all the mods for a given Minecraft version.

func AllModsBySlug

func AllModsBySlug(version string) (map[string]*mcf.Mod, error)

AllModsBySlug returns all mods for a given Minecraft version mapped by their slugs.

func LatestFileByID

func LatestFileByID(version string, id uint, name string) (*mcf.ModFile, error)

LatestFileByID returns the latest mod file for a mod's ID and a Minecraft version.

func LatestFileByMod

func LatestFileByMod(version string, mod *mcf.Mod) (*mcf.ModFile, error)

LatestFileByMod returns the latest mod file for a mod and an optional Minecraft version.

func LatestFileForEachArg

func LatestFileForEachArg(args []string, version string, cb LatestFileCallback) error

LatestFileForEachArg concurrently calls cb with the latest file for each id or slug argument and the given Minecraft version.

func LatestFileForEachMod

func LatestFileForEachMod(mods []mcf.Mod, version string, cb LatestFileCallback) error

LatestFileForEachMod concurrently calls cb with the latest file for each mod and the given Minecraft version.

func ModsByArgs

func ModsByArgs(args []string, version string) ([]mcf.Mod, error)

ModsByArgs returns all mods for some given arguments and a Minecraft version.

func ModsBySlug

func ModsBySlug(slugs []string, version string) ([]mcf.Mod, error)

ModsBySlug returns the mods corresponding to each URL slug.

Types

type LatestFileCallback

type LatestFileCallback func(mod *mcf.Mod, latest *mcf.ModFile) error

LatestFileCallback is called concurrently with a mod and its latest file.

Jump to

Keyboard shortcuts

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