go-ipfs-api
go-ipfs-api copied to clipboard
Support `wrap-with-directory` Option
Example
func Wrap(enabled bool) ipfs.AddOpts {
return func(rb *ipfs.RequestBuilder) error {
rb.Option("wrap-with-directory", enabled)
return nil
}
}
FYI, you might want to try the new https://github.com/ipfs/go-ipfs-http-client instead. It's not quite stable but has more features.
@Stebalien Thanks. ☺️ May I ask what is different between go-ipfs-api and go-ipfs-http-client? Can I use the -w option?
@Stebalien Thanks. relaxed May I ask what is different between go-ipfs-api and go-ipfs-http-client?
go-ipfs-http-client is intended to replace this library.
Can I use the -w option?
With this library, you'll have to add that option. With go-ipfs-http-client, you'd call:
Unixfs().Add(ctx, files.NewMapDirectory(map[string]files.Node{
"filename": files.NewReaderFile(myFile)
})
@Stebalien Thank you. I'll try it ASAP. 🚀
I think someone already raised PR. I think this can be linked with the PR.
https://github.com/ipfs/go-ipfs-api/pull/294