mirror of
https://github.com/logos-storage/logos-storage-go-bindings.git
synced 2026-01-05 23:13:09 +00:00
Update README
This commit is contained in:
parent
40aadaf104
commit
27b68f6d8f
@ -171,7 +171,8 @@ buf := bytes.NewBuffer([]byte("Hello World!"))
|
|||||||
onProgress := func(read, total int, percent float64, err error) {
|
onProgress := func(read, total int, percent float64, err error) {
|
||||||
// Do something with the data
|
// Do something with the data
|
||||||
}
|
}
|
||||||
cid, err := codex.UploadReader(UploadOptions{filepath: "hello.txt", onProgress: onProgress}, buf)
|
ctx := context.Background()
|
||||||
|
cid, err := codex.UploadReader(ctx, UploadOptions{filepath: "hello.txt", onProgress: onProgress}, buf)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### file
|
#### file
|
||||||
@ -187,7 +188,8 @@ The `UploadFile` returns the cid of the content uploaded.
|
|||||||
onProgress := func(read, total int, percent float64, err error) {
|
onProgress := func(read, total int, percent float64, err error) {
|
||||||
// Do something with the data
|
// Do something with the data
|
||||||
}
|
}
|
||||||
cid, err := codex.UploadFile(UploadOptions{filepath: "./testdata/hello.txt", onProgress: onProgress})
|
ctx := context.Background()
|
||||||
|
cid, err := codex.UploadFile(ctx, UploadOptions{filepath: "./testdata/hello.txt", onProgress: onProgress})
|
||||||
```
|
```
|
||||||
|
|
||||||
#### chunks
|
#### chunks
|
||||||
@ -242,7 +244,8 @@ opt := DownloadStreamOptions{
|
|||||||
// Handle progress
|
// Handle progress
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
err := codex.DownloadStream(cid, opt)
|
ctx := context.Background()
|
||||||
|
err := codex.DownloadStream(ctx, cid, opt)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### chunks
|
#### chunks
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user