2018-07-04 16:30:24 +00:00
|
|
|
package adder
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"mime/multipart"
|
|
|
|
|
2018-08-06 10:44:44 +00:00
|
|
|
"github.com/ipfs/ipfs-cluster/api"
|
|
|
|
|
2018-07-19 13:17:27 +00:00
|
|
|
cid "github.com/ipfs/go-cid"
|
2018-07-04 16:30:24 +00:00
|
|
|
logging "github.com/ipfs/go-log"
|
|
|
|
)
|
|
|
|
|
|
|
|
var logger = logging.Logger("adder")
|
|
|
|
|
2018-07-24 12:21:29 +00:00
|
|
|
// Adder represents a module capable of adding content to IPFS Cluster.
|
2018-07-04 16:30:24 +00:00
|
|
|
type Adder interface {
|
2018-07-19 13:17:27 +00:00
|
|
|
// FromMultipart adds from a multipart reader and returns
|
|
|
|
// the resulting CID.
|
2018-08-06 10:44:44 +00:00
|
|
|
FromMultipart(context.Context, *multipart.Reader, *api.AddParams) (*cid.Cid, error)
|
2018-08-06 20:49:28 +00:00
|
|
|
|
|
|
|
// Output returns a channel from which to read updates during the adding
|
|
|
|
// process.
|
|
|
|
Output() <-chan *api.AddedOutput
|
2018-07-04 16:30:24 +00:00
|
|
|
}
|