compression

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package for working with tar.gz files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(inputFilePath, outputFilePath string) (err error)

Compress creates a archive from the folder inputFilePath points to in the file outputFilePath points to. Only adds the last directory in inputFilePath to the archive, not the whole path. It tries to create the directory structure outputFilePath contains if it doesn't exist. It returns potential errors to be checked or nil if everything works. - inputFilePath: the path to the folder to compress - outputFilePath: the path to the archive to create - returns: an error if there is one

func Extract

func Extract(inputFilePath, outputFilePath string) (err error)

Extract extracts a archive from the file inputFilePath points to in the directory outputFilePath points to. It tries to create the directory structure outputFilePath contains if it doesn't exist. It returns potential errors to be checked or nil if everything works. - inputFilePath: the path to the archive to extract - outputFilePath: the path to the folder to create - returns: an error if there is one

func ExtractFile

func ExtractFile(filePath string, file_name string) ([]byte, error)

ExtractFile It opens a gzip file, reads it as a tar file, and returns the contents of the file with the name you specify - filePath: the path to the archive to extract - file_name: the name of the file to extract - returns: the contents of the file with the name you specify - returns: an error if there is one

Types

This section is empty.

Jump to

Keyboard shortcuts

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