ggpack

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package ggpack reads and writes ggpack files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pack

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

Pack provides read access to the contents of a ggpack file. It implements the fs.FS, fs.ReadDirFS and io.Closer interfaces.

func Open

func Open(path string) (*Pack, error)

func OpenUsingKey

func OpenUsingKey(path string, key xor.Key) (*Pack, error)

OpenUsingKey is the same as Open, but uses a different key than the default key (xor.DefaultKey) for XOR decryption of the pack.

func (*Pack) Close

func (p *Pack) Close() error

func (*Pack) Open added in v0.6.0

func (p *Pack) Open(name string) (fs.File, error)

func (*Pack) ReadDir added in v0.6.0

func (p *Pack) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir reads the named directory and returns a list of directory entries sorted by filename.

The only directory in a Pack is the root directory ".".

type Packer

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

func NewPacker

func NewPacker(w io.WriteSeeker) (*Packer, error)

func (*Packer) Finish

func (p *Packer) Finish() error

func (*Packer) SetKey

func (p *Packer) SetKey(key xor.Key)

SetKey sets the key for XOR encryption, if a different key than the default key (xor.DefaultKey) should be used. The key should be set before any write operations.

func (*Packer) Write

func (p *Packer) Write(filenameInPack string, r io.Reader, size int64) error

func (*Packer) WriteFile

func (p *Packer) WriteFile(path string) error

func (*Packer) WriteFileAs

func (p *Packer) WriteFileAs(filenameInPack, sourceFilePath string) error

func (*Packer) WriteFiles

func (p *Packer) WriteFiles(paths []string) error

Jump to

Keyboard shortcuts

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