百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

go-siva

> 编程语言
开源

siva - 可查找、有索引、可验证的归档工具

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

siva - 可查找、有索引、可验证的归档工具

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goarchivesiva

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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