catalog

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CatalogVersion = 3
)

Variables

This section is empty.

Functions

func WriteFile added in v0.8.0

func WriteFile(name string, catalog *Catalog) error

Writes the contents of the *Catalog to the file specified by path.

Types

type Catalog

type Catalog struct {
	Version int32

	PackNames []string
	Records   []*Record
}

func New added in v0.8.0

func New(files map[string][]string) *Catalog

Creates a new catalog from a map of pack names to a list of file names.

func ReadFile added in v0.8.0

func ReadFile(name string) (*Catalog, error)

Creates a *Catalog out of the *os.File from the given path.

func ReadFrom added in v0.8.0

func ReadFrom(r io.Reader) (*Catalog, error)

Creates a *Catalog from the contents of the given io.Reader.

func (*Catalog) Search

func (catalog *Catalog) Search(path string) (*Record, bool)

func (*Catalog) WriteTo added in v0.8.0

func (catalog *Catalog) WriteTo(w io.Writer) (n int64, err error)

type Record added in v0.8.0

type Record struct {
	PackName string

	Crc uint32
	binarytree.Indices

	IsCompressed bool
}

func (*Record) TreeIndices added in v0.8.0

func (record *Record) TreeIndices() *binarytree.Indices

type RecordError added in v0.8.0

type RecordError struct {
	Err   error
	Field string
}

func (*RecordError) Error added in v0.8.0

func (err *RecordError) Error() string

func (*RecordError) Unwrap added in v0.8.0

func (err *RecordError) Unwrap() error

Jump to

Keyboard shortcuts

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