S3Transfer

S3Transfer

S3Transfer keeps track of information about an upload or download operation being performed by the S3Client plugin. It also contains the OperationResult record that the S3Client will return when it emits its finish event.

There is some overlap between info contained in an S3Transfer and the info in an OperationResult. The S3Transfer record is for the S3Client's internal use, and includes information that is not useful to any other plugin.

The OperationResult is an object intended to be returned or emitted by many plugins to describe the outcode of their work in a uniform manner.

Constructor

new S3Transfer(operation, provider)

Creates a new S3Transfer object.

Parameters:
Name Type Description
operation string

The name of the operation that the S3Client will perform. This should be 'upload' or 'download'.

provider string

The name of the provilder (Plugin) performing the operation.

Source:

Members

bucket :string

The name of the bucket on the S3 server to which we should upload or from which we should download.

Source:

bytesTransferred :number

The number of bytes transferred to or from the remote host.

Source:

error :string

The last error to occur during an operation by the S3 client. For a full list of errors, check the result.errors list.

Source:

etag :string

The etag of a file uploaded to S3. This will be set after the upload completes. For downloads, it will remain null.

Source:

host :string

The name or IP address of the S3 host.

Source:

key :string

The name of the key (a.k.a the object name) on the S3 server that we want to put or get.

Source:

localPath :string

The path to the file on the locally mounted filesystem that we want to upload to S3 in an upload operation. For downloads, this is the path to which we'll save the S3 object we retrieve.

Source:

localStat :fs.stats

An fs.stats object describing the size, mtime, uid, etc. of the file at localPath. For uploads, this will be set before the upload begins. For downloads, it will be set after the download completes.

Source:

operation :string

The name of the S3 operation. This should be either 'upload' or 'download'.

Source:

port :number

The port number of the S3 host that our client should connect to. You can usually leave this blank.

Source:

remoteStat :fs.stats

An object describing the size and etag of an object uploaded to S3. For uploads, this will be set after the upload completes. For downloads, it will remain null.

Source:

result :OperationResult

An object describing the outcome of an upload or download operation, including any errors that may have occurred.

Source:

Methods

getRemoteUrl() → {string}

This returns the URL of the object on the S3 server that we are trying to upload or download.

Source: