Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultUploadConcurrency = 3
DefaultUploadConcurrency is the default number of goroutines to spin up when using Upload().
View Source
const DefaultUploadPartSize = MinUploadPartSize
DefaultUploadPartSize is the default part size to buffer chunks of a payload into.
View Source
const MaxUploadParts = 10000
MaxUploadParts is the maximum allowed number of parts in a multi-part upload on Amazon S3.
View Source
const MinUploadPartSize int64 = 1024 * 1024 * 5
MinUploadPartSize is the minimum allowed part size when uploading a part to Amazon S3.
Variables ¶
View Source
var ErrDeadlineReached = errors.New("upload: deadline reached trying to upload")
ErrDeadlineReached is an error returned if the Deadline is reached
Functions ¶
Types ¶
type Options ¶
type Options struct {
// APIKey is required for communication
APIKey string
// The buffer size (in bytes) to use when buffering data into chunks and
// sending them as parts to S3. The minimum allowed part size is 5MB, and
// if this value is set to zero, the DefaultUploadPartSize value will be used.
PartSize int64
// The number of goroutines to spin up in parallel per call to Upload when
// sending parts. If this is set to zero, the DefaultUploadConcurrency value
// will be used.
//
// The concurrency pool is not shared between calls to Upload.
Concurrency int
// Body is the content to upload. It's the responsibility of the caller to close this reader itself
Body io.Reader
// ContentType is the body content type
ContentType string
// URL to upload the parts to
URL string
// HTTPClientConfig is a custom httpclient.Config in case you want to override the behavior
HTTPClientConfig *httpclient.Config
// Deadline is the time by which the upload (or any part) should have finished before returning ErrDeadlineReached
// defaults to 10 minutes if not provided
Deadline time.Time
}
Options for configuring the upload
Click to show internal directories.
Click to hide internal directories.