chunksize

package
v1.61.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 1 Imported by: 3

Documentation

Overview

Package chunksize calculates a suitable chunk size for large uploads

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Calculator

func Calculator(o interface{}, size int64, maxParts int, defaultChunkSize fs.SizeSuffix) fs.SizeSuffix

Calculator calculates the minimum chunk size needed to fit within the maximum number of parts, rounded up to the nearest fs.Mebi.

For most backends, (chunk_size) * (concurrent_upload_routines) memory will be required so we want to use the smallest possible chunk size that's going to allow the upload to proceed. Rounding up to the nearest fs.Mebi on the assumption that some backends may only allow integer type parameters when specifying the chunk size.

Returns the default chunk size if it is sufficiently large enough to support the given file size otherwise returns the smallest chunk size necessary to allow the upload to proceed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL