提交 694ab679 作者: Hector Sanjuan

Golint: unixfs/archive

License: MIT
Signed-off-by: 's avatarHector Sanjuan <hector@protocol.ai>
上级 16a54a85
// Package archive provides utilities to archive and compress a [Unixfs] DAG.
package archive
import (
......
// Package tar provides functionality to write a unixfs merkledag
// as a tar archive.
package tar
import (
......@@ -69,6 +71,7 @@ func (w *Writer) writeFile(nd *mdag.ProtoNode, pb *upb.Data, fpath string) error
return nil
}
// WriteNode adds a node to the archive.
func (w *Writer) WriteNode(nd ipld.Node, fpath string) error {
switch nd := nd.(type) {
case *mdag.ProtoNode:
......@@ -106,6 +109,7 @@ func (w *Writer) WriteNode(nd ipld.Node, fpath string) error {
}
}
// Close closes the tar writer.
func (w *Writer) Close() error {
return w.TarW.Close()
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论