util

package
v0.0.0-...-4a08baf Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CURSECDN_URL_BASE = "https://modloaders.cursecdn.com/647622546/maven/"

Variables

View Source
var GENERIC_FALLBACK_MAVEN_BASE_URLS = []string{"https://libraries.minecraft.net/",
	"https://files.minecraftforge.net/maven/",
	"https://repo1.maven.org/maven2/"}

Functions

func Copyfile

func Copyfile(src string, dest string) error

func ExtractFileFromTarBz2

func ExtractFileFromTarBz2(tarfile string, filename string, destination string) error

func ExtractFileFromZip

func ExtractFileFromZip(zipfile string, filename string, destination string) error

func MinecraftVersionAsInteger

func MinecraftVersionAsInteger(version string) (int, error)

func ReadFileFromTarBz2

func ReadFileFromTarBz2(tarfile string, filename string) ([]byte, error)

func ReadFileFromZip

func ReadFileFromZip(zipfile string, filename string) ([]byte, error)

Types

type Downloader

type Downloader struct {
	DownloadDir string
}

func NewDownloader

func NewDownloader(downloadDir string) *Downloader

func (*Downloader) DownloadToDefaultFilename

func (d *Downloader) DownloadToDefaultFilename(downloadUrl string) (string, error)

func (*Downloader) DownloadToSpecificFilename

func (d *Downloader) DownloadToSpecificFilename(downloadUrl string, filename string) (string, error)

func (*Downloader) NewSubdownloader

func (d *Downloader) NewSubdownloader(downloadDir string) *Downloader

type Library

type Library struct {
	Name string
	// contains filtered or unexported fields
}

func NewLibrary

func NewLibrary(libraryJson []byte) (*Library, error)

func NewLibraryFromName

func NewLibraryFromName(name, url string) (*Library, error)

func (*Library) ExtractExcludes

func (l *Library) ExtractExcludes() []string

func (*Library) GetArtifact

func (l *Library) GetArtifact() string

func (*Library) GetDownloadUrl

func (l *Library) GetDownloadUrl() string

func (*Library) GetDownloadUrls

func (l *Library) GetDownloadUrls() []string

func (*Library) GetFilename

func (l *Library) GetFilename() string

func (*Library) GetNative

func (l *Library) GetNative() string

func (*Library) GetPath

func (l *Library) GetPath() string

func (*Library) GetPathLocal

func (l *Library) GetPathLocal() string

func (*Library) Matches

func (l *Library) Matches() bool

func (*Library) MustExtract

func (l *Library) MustExtract() bool

Jump to

Keyboard shortcuts

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