core/coreunix: Documented return values
Matt Bell committed
Feb 2, 2015 at 10:13 UTC
e5f3ac99c31121a88bc08c9784b5e950b7fcb333
1 file changed
+2
core/coreunix/add.go
+2
@@ -67,6 +67,8 @@ func AddR(n *core.IpfsNode, root string) (key string, err error) {
67
68
// AddWrapped adds data from a reader, and wraps it with a directory object
69
// to preserve the filename.
70
+// Returns the path of the added file ("<dir hash>/filename"), the DAG node of
71
+// the directory, and and error if any.
72
func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, *merkledag.Node, error) {
73
file := files.NewReaderFile(filename, ioutil.NopCloser(r), nil)
74
dir := files.NewSliceFile("", []files.File{file})