Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotEnoughParts = errors.New("Not enough Parts")
ErrNotEnoughParts will be used when writing more than size * len(partURLs)
Functions ¶
This section is empty.
Types ¶
type CompleteMultipartUpload ¶
type CompleteMultipartUpload struct {
Part []*completeMultipartUploadPart
}
CompleteMultipartUpload is the S3 CompleteMultipartUpload body
func (*CompleteMultipartUpload) BuildMultipartUploadETag ¶
func (cmu *CompleteMultipartUpload) BuildMultipartUploadETag() (string, error)
BuildMultipartUploadETag creates an S3 compatible ETag for MultipartUpload Given the MD5 hash for each uploaded part of the file, concatenate the hashes into a single binary string and calculate the MD5 hash of that result, the append "-len(etags)" http://permalink.gmane.org/gmane.comp.file-systems.s3.s3tools/583
type CompleteMultipartUploadError ¶
type CompleteMultipartUploadError struct { XMLName xml.Name `xml:"Error"` Code string Message string }
CompleteMultipartUploadError is the in-body error structure https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html#mpUploadComplete-examples the answer contains other fields we are not using
func (*CompleteMultipartUploadError) Error ¶
func (c *CompleteMultipartUploadError) Error() string
type CompleteMultipartUploadResult ¶
CompleteMultipartUploadResult is the S3 answer to CompleteMultipartUpload request
type Multipart ¶
type Multipart struct { // CompleteURL is a presigned URL for CompleteMultipartUpload CompleteURL string // AbortURL is a presigned URL for AbortMultipartUpload AbortURL string // DeleteURL is a presigned URL for RemoveObject DeleteURL string // contains filtered or unexported fields }
Multipart represents a MultipartUpload on a S3 compatible Object Store service. It can be used as io.WriteCloser for uploading an object
func NewMultipart ¶
func NewMultipart(ctx context.Context, partURLs []string, completeURL, abortURL, deleteURL string, putHeaders map[string]string, deadline time.Time, partSize int64) (*Multipart, error)
NewMultipart provides Multipart pointer that can be used for uploading. Data written will be split buffered on disk up to size bytes then uploaded with S3 Upload Part. Once Multipart is Closed a final call to CompleteMultipartUpload will be sent. In case of any error a call to AbortMultipartUpload will be made to cleanup all the resources
func (*Multipart) Close ¶
func (u *Multipart) Close() error
Close implements the standard io.Closer interface: it closes the http client request. This method will also wait for the connection to terminate and return any error occurred during the upload
type Object ¶
type Object struct { // PutURL is a presigned URL for PutObject PutURL string // DeleteURL is a presigned URL for RemoveObject DeleteURL string // contains filtered or unexported fields }
Object represents an object on a S3 compatible Object Store service. It can be used as io.WriteCloser for uploading an object
func NewObject ¶
func NewObject(ctx context.Context, putURL, deleteURL string, putHeaders map[string]string, deadline time.Time, size int64) (*Object, error)
NewObject opens an HTTP connection to Object Store and returns an Object pointer that can be used for uploading.
func (*Object) Close ¶
func (u *Object) Close() error
Close implements the standard io.Closer interface: it closes the http client request. This method will also wait for the connection to terminate and return any error occurred during the upload
type StatusCodeError ¶
type StatusCodeError error
type Upload ¶
type Upload interface { io.WriteCloser ETag() string }
Upload represents an upload to an ObjectStorage provider