mirror of
https://github.com/logos-storage/logos-storage-go-bindings.git
synced 2026-01-02 13:33:10 +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) {
|
||||
// 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
|
||||
@ -187,7 +188,8 @@ The `UploadFile` returns the cid of the content uploaded.
|
||||
onProgress := func(read, total int, percent float64, err error) {
|
||||
// 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
|
||||
@ -242,7 +244,8 @@ opt := DownloadStreamOptions{
|
||||
// Handle progress
|
||||
},
|
||||
}
|
||||
err := codex.DownloadStream(cid, opt)
|
||||
ctx := context.Background()
|
||||
err := codex.DownloadStream(ctx, cid, opt)
|
||||
```
|
||||
|
||||
#### chunks
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user