Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

go-siva

> 编程语言
Open source

siva - seekable indexed verifiable archiver

100 stars0 likes0 views
WebsiteGitHub

About

siva - seekable indexed verifiable archiver

siva format

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.

  • Library reference
  • Command-line interface
  • Format specification

Installation

The recommended way to install siva

go get -u gopkg.in/src-d/go-siva.v1/...

Example

Creating a siva file:

…

Reading from a siva file:

go
// 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()
}

Command-line interface

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.

Other comments

  • The 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.
  • This implementation left in the client of the library side the task of check the integrity of the file contents. It just checks for the Index integrity.

License

MIT, see LICENSE

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goarchivesiva

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言