pack

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RepackageFile

func RepackageFile(file string, manifest *manifest.Manifest)

RepackageFile takes the given zip file, recreates it without compression and optionally injects the manifest specified. The compression is removed to help with deduplication – especially on IPFS. The compression also is almost negligible for mod jars

Types

type PackageFile

type PackageFile struct {
	*os.File
	*Reader
}

PackageFile is a local zip (or jar) file that may contain a minepkg.toml

func Open

func Open(filePath string) (*PackageFile, error)

Open will open the package (zip or jar) file specified by name and return a PackageFile.

type Reader

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

Reader for a zip (or jar) file that may contain a minepkg.toml

func NewReader

func NewReader(reader io.ReaderAt, size int64) *Reader

NewReader returns a Package from a `io.ReaderAt`

func (*Reader) ExtractModpack

func (p *Reader) ExtractModpack(dest string) error

ExtractModpack will extract everything in this zip file to `dest` but will NOT overwrite existing save files

func (*Reader) Files

func (p *Reader) Files() []*zip.File

Files returns all contained files of the underlying zip/jar file

func (*Reader) Manifest

func (p *Reader) Manifest() *manifest.Manifest

Manifest returns the mod manifest if any

Jump to

Keyboard shortcuts

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