Documentation ¶
Index ¶
Constants ¶
const ( // Maximum number of files in PAK file. MaxFiles = 4096 // Maximum length of file name in PAK file. MaxFileName = 56 // Maximum size of PAK file and all files it contains. MaxOffset = 1<<31 - 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Name string Filepos uint32 Filelen uint32 // contains filtered or unexported fields }
A File is a single file in a PAK archive. The file content can be accessed by calling Open.
func (*File) Open ¶
func (f *File) Open() *io.SectionReader
Open returns a SectionReader that provides access to the File's contents. Multiple files may be read concurrently.
type ReadCloser ¶
type ReadCloser struct { Reader // contains filtered or unexported fields }
A ReadCloser is a Reader that must be closed when no longer needed.
func OpenReader ¶
func OpenReader(name string) (*ReadCloser, error)
OpenReader will open the PAK file specified by name and return a ReadCloser.
func (*ReadCloser) Close ¶
func (pak *ReadCloser) Close() error
Close closes the PAK file, rendering it unusable for I/O.
type Reader ¶
type Reader struct { File []*File // contains filtered or unexported fields }
A Reader serves content from a PAK archive.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements a PAK file writer.
func NewWriter ¶
func NewWriter(w io.WriteSeeker) (*Writer, error)
NewWriter returns a new Writer writing a PAK file to w.
func OpenWriter ¶
OpenWriter returns a new Writer writing a PAK file specified by name.
func (*Writer) Close ¶
Close finishes writing the PAK file by writing the header and directory. If Writer was created by OpenWriter it also closes the underlying file.