Documentation
¶
Overview ¶
Package compression implements reading and writing of compressed files.
This package is specifically designed for the LZMA formats used by popular UEFI implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( LZMAGUID = *guid.MustParse("EE4E5898-3914-4259-9D6E-DC7BD79403CF") LZMAX86GUID = *guid.MustParse("D42AE6BD-1352-4BFB-909A-CA72A6EAE889") )
Well-known GUIDs for GUIDed sections containing compressed data.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor interface { // Name is typically the name of a class. Name() string // Decode and Encode obey "x == Decode(Encode(x))". Decode(encodedData []byte) ([]byte, error) Encode(decodedData []byte) ([]byte, error) }
Compressor defines a single compression scheme (such as LZMA).
func CompressorFromGUID ¶
func CompressorFromGUID(guid *guid.GUID) Compressor
CompressorFromGUID returns a Compressor for the corresponding GUIDed Section.
type LZ4 ¶ added in v1.2.0
type LZ4 struct{}
LZ4 implements Compressor and uses a Go-based implementation.
type LZMA ¶
type LZMA struct{}
LZMA implements Compressor and uses a Go-based implementation.
type LZMAX86 ¶
type LZMAX86 struct {
// contains filtered or unexported fields
}
LZMAX86 implements Compressor and includes the X86 filter which is popular in some UEFI implementations.
type SystemLZMA ¶
type SystemLZMA struct {
// contains filtered or unexported fields
}
SystemLZMA implements Compression and calls out to the system's compressor (except for Decode which uses the Go-based decompressor). The sytem's compressor is typically faster and generates smaller files than the Go-based implementation.
func (*SystemLZMA) Decode ¶
func (c *SystemLZMA) Decode(encodedData []byte) ([]byte, error)
Decode decodes a byte slice of LZMA data.
func (*SystemLZMA) Encode ¶
func (c *SystemLZMA) Encode(decodedData []byte) ([]byte, error)
Encode encodes a byte slice with LZMA.
func (*SystemLZMA) Name ¶
func (c *SystemLZMA) Name() string
Name returns the type of compression employed.