tools

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: GPL-3.0 Imports: 10 Imported by: 3

Documentation

Overview

Copyright (C) 2021-2023 Daniele Rondina <geaaru@gmail.org>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareTarReader added in v0.8.0

func PrepareTarReader(file string, opts *TarReaderCompressionOpts) error

func PrepareTarWriter

func PrepareTarWriter(file string, opts *TarCompressionOpts) error

Types

type CompressionMode

type CompressionMode string
const (
	None  CompressionMode = "none"
	Gzip  CompressionMode = "gz"
	Zstd  CompressionMode = "zstd"
	Xz    CompressionMode = "xz"
	Bzip2 CompressionMode = "bz2"
)

func GetCompressionMode added in v0.8.0

func GetCompressionMode(file string) CompressionMode

func ParseCompressionMode

func ParseCompressionMode(s string) CompressionMode

type NopCloseReader added in v0.8.0

type NopCloseReader struct {
	io.Reader
}

func NewNopCloseReader added in v0.8.0

func NewNopCloseReader(r io.Reader) *NopCloseReader

func (*NopCloseReader) Close added in v0.8.0

func (ncw *NopCloseReader) Close() error

type NopCloseWriter

type NopCloseWriter struct {
	*bufio.Writer
}

func NewNopCloseWriter

func NewNopCloseWriter(buf *bufio.Writer) *NopCloseWriter

func (*NopCloseWriter) Close

func (ncw *NopCloseWriter) Close() error

type TarCompressionOpts

type TarCompressionOpts struct {
	UseExt         bool
	Mode           CompressionMode
	FileWriter     io.WriteCloser
	CompressWriter io.WriteCloser
}

func NewTarCompressionOpts

func NewTarCompressionOpts(useExt bool) *TarCompressionOpts

func (*TarCompressionOpts) Close

func (o *TarCompressionOpts) Close()

type TarReaderCompressionOpts added in v0.8.0

type TarReaderCompressionOpts struct {
	UseExt         bool
	Mode           CompressionMode
	CompressReader io.ReadCloser
	FileReader     io.ReadCloser
}

func NewTarReaderCompressionOpts added in v0.8.0

func NewTarReaderCompressionOpts(useExt bool) *TarReaderCompressionOpts

func (*TarReaderCompressionOpts) Close added in v0.8.0

func (o *TarReaderCompressionOpts) Close()

Jump to

Keyboard shortcuts

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