targz

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package targz contains methods to create and extract tar gz archives.

Usage (discarding potential errors):

targz.Compress("path/to/the/directory/to/compress", "my_archive.tar.gz")
targz.Extract("my_archive.tar.gz", "directory/to/extract/to")

This creates an archive in ./my_archive.tar.gz with the folder "compress" (last in the path). And extracts the folder "compress" to "directory/to/extract/to/". The folder structure is created if it doesn't exist.

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.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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