Commit e12c21af authored by Łukasz Magiera's avatar Łukasz Magiera

unixfs add: remove StdinName

parent 91f8aac4
...@@ -33,8 +33,7 @@ type UnixfsAddSettings struct { ...@@ -33,8 +33,7 @@ type UnixfsAddSettings struct {
FsCache bool FsCache bool
NoCopy bool NoCopy bool
Wrap bool Wrap bool
StdinName string
Events chan<- interface{} Events chan<- interface{}
Silent bool Silent bool
...@@ -66,8 +65,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, ...@@ -66,8 +65,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
FsCache: false, FsCache: false,
NoCopy: false, NoCopy: false,
Wrap: false, Wrap: false,
StdinName: "",
Events: nil, Events: nil,
Silent: false, Silent: false,
...@@ -245,15 +243,6 @@ func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption { ...@@ -245,15 +243,6 @@ func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption {
} }
} }
// StdinName is the name set for files which don specify FilePath as
// os.Stdin.Name()
func (unixfsOpts) StdinName(name string) UnixfsAddOption {
return func(settings *UnixfsAddSettings) error {
settings.StdinName = name
return nil
}
}
// Events specifies channel which will be used to report events about ongoing // Events specifies channel which will be used to report events about ongoing
// Add operation. // Add operation.
// //
......
...@@ -292,24 +292,6 @@ func (tp *provider) TestAdd(t *testing.T) { ...@@ -292,24 +292,6 @@ func (tp *provider) TestAdd(t *testing.T) {
}, },
opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)}, opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)},
}, },
{
name: "stdinNamed",
path: "/ipfs/QmQ6cGBmb3ZbdrQW1MRm1RJnYnaxCqfssz7CrTa9NEhQyS",
data: func() files.Node {
rf, err := files.NewReaderPathFile(os.Stdin.Name(), ioutil.NopCloser(strings.NewReader(helloStr)), nil)
if err != nil {
panic(err)
}
return rf
},
expect: func(files.Node) files.Node {
return files.NewMapDirectory(map[string]files.Node{
"test": files.NewBytesFile([]byte(helloStr)),
})
},
opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.StdinName("test")},
},
{ {
name: "twoLevelDirWrapped", name: "twoLevelDirWrapped",
data: twoLevelDir(), data: twoLevelDir(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment