siva - seekable indexed verifiable archiver
siva stand for seekable indexed verifiable archiver
siva is archive format very similar to tar or zip, focused on allowing: constant-time random file access, seekable access to the contained files and concatenable archive files
The library implements a very similar API to the go tar package, allowing full control over and low level access to the contained files.
The recommended way to install siva
go get -u gopkg.in/src-d/go-siva.v1/...Creating a siva file:
…Reading from a siva file:
// Open the siva archive for reading.
file := bytes.NewReader(buf.Bytes())
r := siva.NewReader(file)
// Get all the files in the siva file.
i, err := r.Index()
if err != nil {
log.Fatalln(err)
}
// Iterate through the files in the archive.
for _, e := range i {
content, err := r.Get(e)
if err != nil {
log.Fatalln(err)
}
fmt.Printf("Contents of %s:\n", e.Name)
if _, err := io.Copy(os.Stdout, content); err != nil {
log.Fatalln(err)
}
fmt.Println()
}siva cli interface, is a convenient command that helps you to creates and manipulates siva files.
Output from: ./siva --help:
Usage:
siva [OPTIONS]
Help Options:
-h, --help Show this help message
Available commands:
list List the items contained on a file.
pack Create a new archive containing the specified items.
unpack Extract to disk from the archive.
version Show the version information.Index Signature is specified as a sequence of 3 bytes. Go uses byte as an alias for uint8.File Mode in an Index entry, see issue.Index integrity.MIT, see LICENSE
No open issues yet, or sync has not completed.