update R2bucket put description

This commit is contained in:
syumai 2022-06-18 23:55:27 +09:00
parent fe5bc1a43f
commit f7e4df8b04
2 changed files with 2 additions and 8 deletions

View File

@ -10,8 +10,7 @@
* [ ] R2 - Partially supported * [ ] R2 - Partially supported
- [x] Head - [x] Head
- [x] Get - [x] Get
- [x] Put (load all bytes to memory) - [x] Put
- [ ] Put (stream)
- [x] Delete - [x] Delete
- [x] List - [x] List
- [ ] Options for R2 methods - [ ] Options for R2 methods

View File

@ -103,12 +103,7 @@ func (opts *R2PutOptions) toJS() js.Value {
// * Body field of *R2Object is always nil for Put call. // * Body field of *R2Object is always nil for Put call.
// * if a network error happens, returns error. // * if a network error happens, returns error.
func (r *r2Bucket) Put(key string, value io.ReadCloser, opts *R2PutOptions) (*R2Object, error) { func (r *r2Bucket) Put(key string, value io.ReadCloser, opts *R2PutOptions) (*R2Object, error) {
/* TODO: implement this in FixedLengthStream: https://developers.cloudflare.com/workers/runtime-apis/streams/transformstream/#fixedlengthstream // fetch body cannot be ReadableStream. see: https://github.com/whatwg/fetch/issues/1438
body := convertReaderToReadableStream(value)
streams := fixedLengthStreamClass.New(contentLength)
rs := streams.Get("readable")
body.Call("pipeTo", streams.Get("writable"))
*/
b, err := io.ReadAll(value) b, err := io.ReadAll(value)
if err != nil { if err != nil {
return nil, err return nil, err