Documentation
¶
Overview ¶
Package xzwriter provides a WriteCloser XZWriter that pipes through an external XZ compressor.
Expects the Tukaani XZ tool in $PATH. See the XZ Utils home page: <http://tukaani.org/xz/>
Index ¶
Constants ¶
const ( Fast = 0 Default = 6 Best = 9 )
Variables ¶
var (
ErrOptionIllegal = errors.New("option illegal")
)
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.1.2
func WithCompressLevel ¶ added in v0.1.2
WithCompressLevel sets the compression level between 0 and 9. The constants `Fast`, `Default` and `Best` correspond to the flags `--fast`, `--default` and `--best`.
func WithNiceness ¶ added in v0.2.0
func WithSeparateProcessGroup ¶ added in v0.2.0
func WithSeparateProcessGroup() Option
func WithVerbose ¶ added in v0.1.2
WithVerbose sets verbosity and takes a writer that will be connected to STDERR of the xz subprocess. This provides nice progress output to look at.
type XZWriter ¶
type XZWriter struct {
// contains filtered or unexported fields
}
XZWriter is a WriteCloser that wraps a writer around an XZ compressor.
func NewWithContext ¶
NewWithContext returns an XZWriter, wrapping the writer w. The context may be used to cancel or timeout the external compressor process.
The context can be used to kill the external process early. You still need to call Close() to clean up resources. Alternatively you may call Close() prematurely.
func NewWithOptions ¶ added in v0.1.2
NewWithOptions returns an XZWriter, wrapping the writer w. The context may be used to cancel or timeout the external compressor process.
The context can be used to kill the external process early. You still need to call Close() to clean up resources. Alternatively you may call Close() prematurely.
The compressor process can be configured with options.