Categorygithub.com/pkg6/archive
modulepackage
0.1.1
Repository: https://github.com/pkg6/archive.git
Documentation: pkg.go.dev

# README

archive

A simple Go archiving library.

Example usage

package main

import (
	"github.com/pkg6/archive"
	"log"
	"os"
)

func main() {
	file, err := os.Create("file.zip")
	if err != nil {
		// deal with the error
	}
	zip, err := archive.New(file, "zip")
	if err != nil {
		log.Fatal(err)
	}
	defer zip.Close()
	zip.Add(archive.File{
		Destination: "file.txt",
		Source:      "/path/to/file.txt",
	})
}

Support compression format

  • tar.gz
  • tgz
  • tar
  • gz
  • tar.xz
  • txz
  • tar.zst
  • tzst
  • zip

# Packages

No description provided by the author
No description provided by the author

# Functions

Copy copies the source archive into a new one, which can be appended at.
New archive.
NewGzip gz archive.
NewTar tar archive.
NewTarGz tar.gz archive.
NewTarXz tar.xz archive.
NewTarZst tar.zst archive.
NewZip zip archive.
TarCopy creates a new tar with the contents of the given tar.
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
FileInfo is the file info of a file.
Gzip as gz.
Tar as tar.
No description provided by the author
TarXz as tar.xz.
TarZst as tar.zst.
Zip struct.

# Interfaces

Archive represents a compression archive files from disk can be written to.