Documentation
¶
Overview ¶
Package vpk implements file operations on Valve Software's VPK format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFileTooBig = errors.New("vpk: file too big")
View Source
var ErrInvalidMagic = errors.New("vpk: invalid magic number")
Functions ¶
Types ¶
type Creator ¶
type Creator interface {
// Main creates the main VPK file (*_dir.vpk or no suffix)
Main() (io.WriteCloser, error)
// Archive creates a data-only VPK file (*_###.vpk where # is a digit)
Archive(index int16) (io.WriteCloser, error)
}
func MultiVPKCreator ¶
MultiVPKCreator implements a Creator for a multi-part VPK on the OS filesystem. prefix should be the part before "_dir.vpk".
func SingleVPKCreator ¶
SingleVPKCreator implements a Creator for a single-part VPK on the OS filesystem.
type Entry ¶
type Entry interface {
// The relative path to this file.
Rel() string
// Open the file for reading. Exactly one of the return values must be
// non-nil. The contents of the io.ReadCloser should be the same each
// time Open is called.
Open() (io.ReadCloser, error)
}
type ErrCRCMismatch ¶
type ErrCRCMismatch struct {
Actual, Expected uint32
}
func (ErrCRCMismatch) Error ¶
func (err ErrCRCMismatch) Error() string
type ErrInvalidEntry ¶
type ErrInvalidEntry struct {
Dir, Base, Ext string
}
func (ErrInvalidEntry) Error ¶
func (err ErrInvalidEntry) Error() string
type ErrUnsupportedVersion ¶
type ErrUnsupportedVersion uint32
func (ErrUnsupportedVersion) Error ¶
func (err ErrUnsupportedVersion) Error() string
type Opener ¶
type Opener interface {
// Main opens the main VPK file (*_dir.vpk or no suffix)
Main() (File, error)
// Archive opens a data-only VPK file (*_###.vpk where # is a digit)
Archive(index int16) (File, error)
}
Click to show internal directories.
Click to hide internal directories.