mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
update R2bucket put description
This commit is contained in:
parent
fe5bc1a43f
commit
f7e4df8b04
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user