1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-19 09:52:03 +08:00

coreapi unixfs: progress events

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera
2018-10-04 01:00:26 +02:00
parent f9cf84965d
commit a81ec29baa
8 changed files with 199 additions and 44 deletions

View File

@ -7,7 +7,7 @@ import (
cmds "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
e "github.com/ipfs/go-ipfs/core/commands/e"
"github.com/ipfs/go-ipfs/core/coreunix"
coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface"
tar "github.com/ipfs/go-ipfs/tar"
dag "gx/ipfs/QmcBoNcAP6qDjgRBew7yjvCqHq7p5jMstE44jPUBWBxzsV/go-merkledag"
path "gx/ipfs/QmcjwUb36Z16NJkvDX6ccXPqsFswo6AsRXynyXcLLCphV2/go-path"
@ -60,12 +60,12 @@ represent it.
c := node.Cid()
fi.FileName()
res.SetOutput(&coreunix.AddedObject{
res.SetOutput(&coreiface.AddEvent{
Name: fi.FileName(),
Hash: c.String(),
})
},
Type: coreunix.AddedObject{},
Type: coreiface.AddEvent{},
Marshalers: cmds.MarshalerMap{
cmds.Text: func(res cmds.Response) (io.Reader, error) {
v, err := unwrapOutput(res.Output())
@ -73,7 +73,7 @@ represent it.
return nil, err
}
o, ok := v.(*coreunix.AddedObject)
o, ok := v.(*coreiface.AddEvent)
if !ok {
return nil, e.TypeErr(o, v)
}