-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rewrite add command to use dagwriter #236
Conversation
…er for inline pinning
@@ -72,3 +75,41 @@ func NewDagFromFile(fpath string) (*dag.Node, error) { | |||
|
|||
return NewDagFromReader(f) | |||
} | |||
|
|||
func NewDagFromFileWServer(fpath string, dserv dag.DAGService, p pin.Pinner) (*dag.Node, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...WServer
? ...WithService
?
Since these are more complicated construction funcs, no need to adhere to the New...
form. Could easily be named: ImportFileDag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Ill give them nicer names now, lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, seems like you could just pass the DagWriter in directly. As in, maybe this function should just be taking a dagwriter.
dw, err := uio.NewDagWriter(dserv, chunk.DefaultSplitter)
if err != nil { ... }
nd, err := import.ImportFileDag(filename, dw) // arg lint error.
@whyrusleeping couple of interface comments, otherwise LGTM |
|
||
const ( | ||
Recursive PinMode = iota | ||
Direct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strong, weak? (common vocabulary for this operation)
@whyrusleeping this failed tests. fixed in f0d823c |
Revert ipfs#236: Test go mod in travis and use major versioning in import paths
moved a pinner into the dagwriter for inline pinning