press

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 9 Imported by: 0

README

Press

Compression Algorithm

Support FileIO

  • Tar/UnTar
  • Gzip/UnGzip
  • Tgz/UnTgz

Install

Use the alias "press". To use Press in your Go code:

import "github.com/AkvicorEdwards/press"

To install Press in your $GOPATH:

go get "github.com/AkvicorEdwards/press"

API

Tar(source []string, targetPath, targetFilename string)
TarToFileIO(sources []string, target *os.File)
TarToWriter(sources []string, target *tar.Writer) (err error)
UnTar(tarball, target string)
UnTarFromFileIO(tarball *os.File, target string)
UnTarFromReader(reader *tar.Reader, target string)
Gzip(source, targetPath, targetFilename string)
GzipToFileIO(reader, target *os.File)
UnGzip(source, target string)
UnGzipFromFileIO(reader, target *os.File)
Tgz(source []string, targetPath, targetFilename string)
TgzToFileIO(sources []string, target *os.File)
UnTgz(tarball, target string)
UnTgzFromFileIO(tarball *os.File, target string)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptySource = errors.New("empty source")
View Source
var ErrIsDir = errors.New("is dir")

Functions

func Gzip

func Gzip(source, targetPath, targetFilename string) error

Gzip source to targetPath/targetFilename. if targetFilename=="", targetFilename=sourceFilename.gz

func GzipToFileIO

func GzipToFileIO(reader, target *os.File) (err error)

func Tar

func Tar(sources []string, targetPath, targetFilename string) error

Tar sources to targetPath/targetFilename. if targetFilename=="", targetFilename=sources[0]Filename.tar

func TarToFileIO

func TarToFileIO(sources []string, target *os.File) (err error)

func TarToWriter

func TarToWriter(sources []string, target *tar.Writer) (err error)

func Tgz

func Tgz(sources []string, targetPath, targetFilename string) error

Tgz sources to targetPath/targetFilename. if targetFilename=="", targetFilename=sources[0]Filename.tgz

func TgzToFileIO

func TgzToFileIO(sources []string, target *os.File) (err error)

func UnGzip

func UnGzip(source, target string) error

UnGzip source to target. if target=="", target=source.ugz

func UnGzipFromFileIO

func UnGzipFromFileIO(reader, target *os.File) error

func UnTar

func UnTar(tarball, target string) error

UnTar source to target. if target=="": current path

func UnTarFromFileIO

func UnTarFromFileIO(tarball *os.File, target string) error

func UnTarFromReader

func UnTarFromReader(reader *tar.Reader, target string) error

func UnTgz

func UnTgz(tarball, target string) error

UnTgz source to target. if target=="": current path

func UnTgzFromFileIO

func UnTgzFromFileIO(tarball *os.File, target string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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