Skip to content

Commit

Permalink
Merge pull request #1498 from 0chain/feat/mobile-mode
Browse files Browse the repository at this point in the history
Expose upload mode in mobile and win sdk
  • Loading branch information
dabasov authored May 20, 2024
2 parents 520605a + cba4510 commit 6c2de9f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mobilesdk/zbox/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,3 +877,18 @@ func SetWorkingDir(workDir string) {
func SetMultiOpBatchSize(size int) {
sdk.SetMultiOpBatchSize(size)
}

// SetUploadMode sets upload mode
//
// ## Inputs
// - mode: 0 for low, 1 for medium, 2 for high
func SetUploadMode(mode int) {
switch mode {
case 0:
sdk.SetUploadMode(sdk.UploadModeLow)
case 1:
sdk.SetUploadMode(sdk.UploadModeMedium)
case 2:
sdk.SetUploadMode(sdk.UploadModeHigh)
}
}
15 changes: 15 additions & 0 deletions winsdk/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,3 +782,18 @@ func PauseUpload(allocationID, remotePath *C.char) *C.char {
}
return WithJSON(true, nil)
}

// SetUploadMode sets upload mode
//
// ## Inputs
// - mode: 0 for low, 1 for medium, 2 for high
func SetUploadMode(mode int) {
switch mode {
case 0:
sdk.SetUploadMode(sdk.UploadModeLow)
case 1:
sdk.SetUploadMode(sdk.UploadModeMedium)
case 2:
sdk.SetUploadMode(sdk.UploadModeHigh)
}
}

0 comments on commit 6c2de9f

Please sign in to comment.