files: export DAGService

This commit is contained in:
Sergey Cherepanov authored and Sergey Cherepanov committed 2023-01-11 14:50:20 +03:00
1 parent c565071dad
commit bb25dd0ea1
1 file changed
+6
+6
View File
@@ -31,6 +31,8 @@ type FileService interface {
GetFile(ctx context.Context, c cid.Cid) (ufsio.ReadSeekCloser, error)
// AddFile adds file to ipfs storage
AddFile(ctx context.Context, r io.Reader) (ipld.Node, error)
// DAGService returns ipld.DAGService object
DAGService() ipld.DAGService
app.Component
}
@@ -60,6 +62,10 @@ func (fs *fileService) Name() string {
return CName
}
func (fs *fileService) DAGService() ipld.DAGService {
return fs.merkledag
}
func (fs *fileService) AddFile(ctx context.Context, r io.Reader) (ipld.Node, error) {
dbp := helpers.DagBuilderParams{
Dagserv: fs.merkledag,