xzwriter

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

xzwriter: a trivial Go library for compressing with XZ.

Apache License v2.0 GoDoc

Package xzwriter provides a writer 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/

License

As this is a trivial convenience package, you should probably not import this. Anyway licensed under the Apache License, Version 2.0.

See also

https://github.com/ulikunitz/xz

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XZWriter

type XZWriter struct {
	// contains filtered or unexported fields
}

XZWriter is a WriteCloser that wraps a writer around an XZ compressor.

func New

func New(w io.Writer) (xzwriter *XZWriter, err error)

New returns an XZWriter, wrapping the writer w.

func NewWithContext

func NewWithContext(ctx context.Context, w io.Writer) (*XZWriter, error)

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 ressources. Alternatively you may call Close() prematurely.

func (*XZWriter) Close

func (xz *XZWriter) Close() error

Close implements the io.Closer interface.

func (*XZWriter) Write

func (xz *XZWriter) Write(p []byte) (n int, err error)

Write implements the io.Writer interface.

Jump to

Keyboard shortcuts

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