Documentation ¶
Index ¶
- Constants
- Variables
- func Debug()
- func ErrAPINotSupported(message string) error
- func ErrEntityTooLarge(totalSize, maxObjectSize int64, bucketName, objectName string) error
- func ErrEntityTooSmall(totalSize int64, bucketName, objectName string) error
- func ErrInvalidArgument(message string) error
- func ErrInvalidBucketName(message string) error
- func ErrInvalidObjectName(message string) error
- func ErrNoSuchBucketPolicy(message string) error
- func ErrTransferAccelerationBucket(bucketName string) error
- func ErrUnexpectedEOF(totalRead, totalSize int64, bucketName, objectName string) error
- type BucketInfo
- type BucketLookupType
- type Client
- func New(endpoint, accessKeyID, secretAccessKey string, secure bool) (*Client, error)
- func NewV2(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Client, error)
- func NewV4(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Client, error)
- func NewWithCredentials(endpoint string, creds *credentials.Credentials, secure bool, region string) (*Client, error)
- func NewWithOptions(endpoint string, opts *Options) (*Client, error)
- func NewWithRegion(endpoint, accessKeyID, secretAccessKey string, secure bool, region string) (*Client, error)
- func (c Client) BucketExists(bucketName string) (bool, error)
- func (c Client) CopyObject(dst DestinationInfo, src SourceInfo) error
- func (c Client) CopyObjectWithProgress(dst DestinationInfo, src SourceInfo, progress io.Reader) error
- func (c Client) FGetObject(bucketName, objectName, filePath string, opts GetObjectOptions) error
- func (c Client) FGetObjectWithContext(ctx context.Context, bucketName, objectName, filePath string, ...) error
- func (c Client) FPutObject(bucketName, objectName, filePath string, opts PutObjectOptions) (n int64, err error)
- func (c Client) GetBucketLocation(bucketName string) (string, error)
- func (c Client) GetBucketPolicy(bucketName string) (string, error)
- func (c Client) GetObject(bucketName, objectName string, opts GetObjectOptions) (*Object, error)
- func (c Client) ListBuckets() ([]BucketInfo, error)
- func (c Client) ListIncompleteUploads(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan ObjectMultipartInfo
- func (c Client) ListObjects(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan ObjectInfo
- func (c Client) ListObjectsV2(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan ObjectInfo
- func (c Client) MakeBucket(bucketName string, location string) (err error)
- func (c Client) Presign(method string, bucketName string, objectName string, expires time.Duration, ...) (u *url.URL, err error)
- func (c Client) PresignedGetObject(bucketName string, objectName string, expires time.Duration, ...) (u *url.URL, err error)
- func (c Client) PresignedHeadObject(bucketName string, objectName string, expires time.Duration, ...) (u *url.URL, err error)
- func (c Client) PresignedPostPolicy(p *PostPolicy) (u *url.URL, formData map[string]string, err error)
- func (c Client) PresignedPutObject(bucketName string, objectName string, expires time.Duration) (u *url.URL, err error)
- func (c Client) PutObject(bucketName, objectName string, reader io.Reader, objectSize int64, ...) (n int64, err error)
- func (c Client) RemoveAllBucketNotification(bucketName string) error
- func (c Client) RemoveBucket(bucketName string) error
- func (c Client) RemoveIncompleteUpload(bucketName, objectName string) error
- func (c Client) RemoveObject(bucketName, objectName string) error
- func (c Client) RemoveObjects(bucketName string, objectsCh <-chan string) <-chan RemoveObjectError
- func (c Client) RemoveObjectsWithContext(ctx context.Context, bucketName string, objectsCh <-chan string) <-chan RemoveObjectError
- func (c *Client) SetAppInfo(appName string, appVersion string)
- func (c Client) SetBucketLifecycle(bucketName, lifecycle string) error
- func (c Client) SetBucketNotification(bucketName string, bucketNotification BucketNotification) error
- func (c Client) SetBucketPolicy(bucketName, policy string) error
- func (c *Client) SetCustomTransport(customHTTPTransport http.RoundTripper)
- func (c *Client) SetS3TransferAccelerate(accelerateEndpoint string)
- func (c Client) StatObject(bucketName, objectName string, opts StatObjectOptions) (ObjectInfo, error)
- func (c *Client) TraceErrorsOnlyOff()
- func (c *Client) TraceErrorsOnlyOn(outputStream io.Writer)
- func (c *Client) TraceOff()
- func (c *Client) TraceOn(outputStream io.Writer)
- type CommonPrefix
- type CompletePart
- type ErrorResponse
- type ListBucketResult
- type ListBucketV2Result
- type ListMultipartUploadsResult
- type ListObjectPartsResult
- type Object
- type ObjectInfo
- type ObjectMultipartInfo
- type ObjectPart
- type Options
- type PostPolicy
- func (p *PostPolicy) SetBucket(bucketName string) error
- func (p *PostPolicy) SetContentLengthRange(min, max int64) error
- func (p *PostPolicy) SetContentType(contentType string) error
- func (p *PostPolicy) SetExpires(t time.Time) error
- func (p *PostPolicy) SetKey(key string) error
- func (p *PostPolicy) SetKeyStartsWith(keyStartsWith string) error
- func (p *PostPolicy) SetSuccessStatusAction(status string) error
- func (p *PostPolicy) SetUserData(key string, value string) error
- func (p *PostPolicy) SetUserMetadata(key string, value string) error
- func (p PostPolicy) String() string
- type PutObjectOptions
- type RemoveObjectError
Constants ¶
const DefaultRetryCap = time.Second * 30
DefaultRetryCap - Each retry attempt never waits no longer than this maximum time duration.
const DefaultRetryUnit = time.Second
DefaultRetryUnit - default unit multiplicative per retry. defaults to 1 second.
const MaxJitter = 1.0
MaxJitter will randomize over the full exponential backoff time
const NoJitter = 0.0
NoJitter disables the use of jitter for randomizing the exponential backoff time
Variables ¶
var ErrInvalidObjectPrefix = ErrInvalidObjectName
ErrInvalidObjectPrefix - Invalid object prefix response is similar to object name response.
var MaxRetry = 10
MaxRetry is the maximum number of retries before stopping.
Functions ¶
func ErrAPINotSupported ¶
ErrAPINotSupported - API not supported response The specified API call is not supported
func ErrEntityTooLarge ¶
ErrEntityTooLarge - Input size is larger than supported maximum.
func ErrEntityTooSmall ¶
ErrEntityTooSmall - Input size is smaller than supported minimum.
func ErrInvalidArgument ¶
ErrInvalidArgument - Invalid argument response.
func ErrInvalidBucketName ¶
ErrInvalidBucketName - Invalid bucket name response.
func ErrInvalidObjectName ¶
ErrInvalidObjectName - Invalid object name response.
func ErrNoSuchBucketPolicy ¶
ErrNoSuchBucketPolicy - No Such Bucket Policy response The specified bucket does not have a bucket policy.
func ErrTransferAccelerationBucket ¶
ErrTransferAccelerationBucket - bucket name is invalid to be used with transfer acceleration.
func ErrUnexpectedEOF ¶
ErrUnexpectedEOF - Unexpected end of file reached.
Types ¶
type BucketInfo ¶
type BucketInfo struct { // The name of the bucket. Name string `json:"name"` // Date the bucket was created. CreationDate time.Time `json:"creationDate"` }
BucketInfo container for bucket metadata.
type BucketLookupType ¶
type BucketLookupType int
BucketLookupType is type of url lookup supported by server.
const ( BucketLookupAuto BucketLookupType = iota BucketLookupDNS BucketLookupPath )
Different types of url lookup supported by the server.Initialized to BucketLookupAuto
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements Amazon S3 compatible methods.
func NewWithCredentials ¶
func NewWithCredentials(endpoint string, creds *credentials.Credentials, secure bool, region string) (*Client, error)
NewWithCredentials - instantiate minio client with credentials provider for retrieving credentials from various credentials provider such as IAM, File, Env etc.
func NewWithOptions ¶
NewWithOptions - instantiate minio client with options
func NewWithRegion ¶
func NewWithRegion(endpoint, accessKeyID, secretAccessKey string, secure bool, region string) (*Client, error)
NewWithRegion - instantiate minio client, with region configured. Unlike New(), NewWithRegion avoids bucket-location lookup operations and it is slightly faster. Use this function when if your application deals with single region.
func (Client) BucketExists ¶
BucketExists verify if bucket exists and you have permission to access it.
func (Client) CopyObject ¶
CopyObject - copy a source object into a new object
func (Client) CopyObjectWithProgress ¶
func (c Client) CopyObjectWithProgress(dst DestinationInfo, src SourceInfo, progress io.Reader) error
CopyObjectWithProgress - copy a source object into a new object, optionally takes progress bar input to notify current progress.
func (Client) FGetObject ¶
FGetObject - download contents of an object to a local file.
func (Client) FGetObjectWithContext ¶
func (c Client) FGetObjectWithContext(ctx context.Context, bucketName, objectName, filePath string, opts GetObjectOptions) error
FGetObjectWithContext - download contents of an object to a local file. The options can be used to specify the GET request further.
func (Client) FPutObject ¶
func (c Client) FPutObject(bucketName, objectName, filePath string, opts PutObjectOptions) (n int64, err error)
FPutObject - Create an object in a bucket, with contents from file at filePath
func (Client) GetBucketLocation ¶
GetBucketLocation - get location for the bucket name from location cache, if not fetch freshly by making a new request.
func (Client) GetBucketPolicy ¶
GetBucketPolicy - get bucket policy at a given path.
func (Client) ListBuckets ¶
func (c Client) ListBuckets() ([]BucketInfo, error)
ListBuckets list all buckets owned by this authenticated user.
This call requires explicit authentication, no anonymous requests are allowed for listing buckets.
api := client.New(....) for message := range api.ListBuckets() { fmt.Println(message) }
func (Client) ListIncompleteUploads ¶
func (c Client) ListIncompleteUploads(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan ObjectMultipartInfo
ListIncompleteUploads - List incompletely uploaded multipart objects.
ListIncompleteUploads lists all incompleted objects matching the objectPrefix from the specified bucket. If recursion is enabled it would list all subdirectories and all its contents.
Your input parameters are just bucketName, objectPrefix, recursive and a done channel to pro-actively close the internal go routine. If you enable recursive as 'true' this function will return back all the multipart objects in a given bucket name.
api := client.New(....) // Create a done channel. doneCh := make(chan struct{}) defer close(doneCh) // Recurively list all objects in 'mytestbucket' recursive := true for message := range api.ListIncompleteUploads("mytestbucket", "starthere", recursive) { fmt.Println(message) }
func (Client) ListObjects ¶
func (c Client) ListObjects(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan ObjectInfo
ListObjects - (List Objects) - List some objects or all recursively.
ListObjects lists all objects matching the objectPrefix from the specified bucket. If recursion is enabled it would list all subdirectories and all its contents.
Your input parameters are just bucketName, objectPrefix, recursive and a done channel for pro-actively closing the internal go routine. If you enable recursive as 'true' this function will return back all the objects in a given bucket name and object prefix.
api := client.New(....) // Create a done channel. doneCh := make(chan struct{}) defer close(doneCh) // Recurively list all objects in 'mytestbucket' recursive := true for message := range api.ListObjects("mytestbucket", "starthere", recursive, doneCh) { fmt.Println(message) }
func (Client) ListObjectsV2 ¶
func (c Client) ListObjectsV2(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan ObjectInfo
ListObjectsV2 lists all objects matching the objectPrefix from the specified bucket. If recursion is enabled it would list all subdirectories and all its contents.
Your input parameters are just bucketName, objectPrefix, recursive and a done channel for pro-actively closing the internal go routine. If you enable recursive as 'true' this function will return back all the objects in a given bucket name and object prefix.
api := client.New(....) // Create a done channel. doneCh := make(chan struct{}) defer close(doneCh) // Recursively list all objects in 'mytestbucket' recursive := true for message := range api.ListObjectsV2("mytestbucket", "starthere", recursive, doneCh) { fmt.Println(message) }
func (Client) MakeBucket ¶
MakeBucket creates a new bucket with bucketName.
Location is an optional argument, by default all buckets are created in US Standard Region.
For Amazon S3 for more supported regions - http://docs.aws.amazon.com/general/latest/gr/rande.html For Google Cloud Storage for more supported regions - https://cloud.google.com/storage/docs/bucket-locations
func (Client) Presign ¶
func (c Client) Presign(method string, bucketName string, objectName string, expires time.Duration, reqParams url.Values) (u *url.URL, err error)
Presign - returns a presigned URL for any http method of your choice along with custom request params. URL can have a maximum expiry of upto 7days or a minimum of 1sec.
func (Client) PresignedGetObject ¶
func (c Client) PresignedGetObject(bucketName string, objectName string, expires time.Duration, reqParams url.Values) (u *url.URL, err error)
PresignedGetObject - Returns a presigned URL to access an object data without credentials. URL can have a maximum expiry of upto 7days or a minimum of 1sec. Additionally you can override a set of response headers using the query parameters.
func (Client) PresignedHeadObject ¶
func (c Client) PresignedHeadObject(bucketName string, objectName string, expires time.Duration, reqParams url.Values) (u *url.URL, err error)
PresignedHeadObject - Returns a presigned URL to access object metadata without credentials. URL can have a maximum expiry of upto 7days or a minimum of 1sec. Additionally you can override a set of response headers using the query parameters.
func (Client) PresignedPostPolicy ¶
func (c Client) PresignedPostPolicy(p *PostPolicy) (u *url.URL, formData map[string]string, err error)
PresignedPostPolicy - Returns POST urlString, form data to upload an object.
func (Client) PresignedPutObject ¶
func (c Client) PresignedPutObject(bucketName string, objectName string, expires time.Duration) (u *url.URL, err error)
PresignedPutObject - Returns a presigned URL to upload an object without credentials. URL can have a maximum expiry of upto 7days or a minimum of 1sec.
func (Client) PutObject ¶
func (c Client) PutObject(bucketName, objectName string, reader io.Reader, objectSize int64, opts PutObjectOptions) (n int64, err error)
PutObject creates an object in a bucket.
You must have WRITE permissions on a bucket to create an object.
- For size smaller than 128MiB PutObject automatically does a single atomic Put operation.
- For size larger than 128MiB PutObject automatically does a multipart Put operation.
- For size input as -1 PutObject does a multipart Put operation until input stream reaches EOF. Maximum object size that can be uploaded through this operation will be 5TiB.
func (Client) RemoveAllBucketNotification ¶
RemoveAllBucketNotification - Remove bucket notification clears all previously specified config
func (Client) RemoveBucket ¶
RemoveBucket deletes the bucket name.
All objects (including all object versions and delete markers). in the bucket must be deleted before successfully attempting this request.
func (Client) RemoveIncompleteUpload ¶
RemoveIncompleteUpload aborts an partially uploaded object.
func (Client) RemoveObject ¶
RemoveObject remove an object from a bucket.
func (Client) RemoveObjects ¶
func (c Client) RemoveObjects(bucketName string, objectsCh <-chan string) <-chan RemoveObjectError
RemoveObjects removes multiple objects from a bucket. The list of objects to remove are received from objectsCh. Remove failures are sent back via error channel.
func (Client) RemoveObjectsWithContext ¶
func (c Client) RemoveObjectsWithContext(ctx context.Context, bucketName string, objectsCh <-chan string) <-chan RemoveObjectError
RemoveObjectsWithContext - Identical to RemoveObjects call, but accepts context to facilitate request cancellation.
func (*Client) SetAppInfo ¶
SetAppInfo - add application details to user agent.
func (Client) SetBucketLifecycle ¶
SetBucketLifecycle set the lifecycle on an existing bucket.
func (Client) SetBucketNotification ¶
func (c Client) SetBucketNotification(bucketName string, bucketNotification BucketNotification) error
SetBucketNotification saves a new bucket notification.
func (Client) SetBucketPolicy ¶
SetBucketPolicy set the access permissions on an existing bucket.
func (*Client) SetCustomTransport ¶
func (c *Client) SetCustomTransport(customHTTPTransport http.RoundTripper)
SetCustomTransport - set new custom transport.
func (*Client) SetS3TransferAccelerate ¶
SetS3TransferAccelerate - turns s3 accelerated endpoint on or off for all your requests. This feature is only specific to S3 for all other endpoints this function does nothing. To read further details on s3 transfer acceleration please vist - http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html
func (Client) StatObject ¶
func (c Client) StatObject(bucketName, objectName string, opts StatObjectOptions) (ObjectInfo, error)
StatObject verifies if object exists and you have permission to access.
func (*Client) TraceErrorsOnlyOff ¶
func (c *Client) TraceErrorsOnlyOff()
TraceErrorsOnlyOff - Turns off the errors only tracing and everything will be traced after this call. If all tracing needs to be turned off, call TraceOff().
func (*Client) TraceErrorsOnlyOn ¶
TraceErrorsOnlyOn - same as TraceOn, but only errors will be traced.
type CommonPrefix ¶
type CommonPrefix struct {
Prefix string
}
CommonPrefix container for prefix response.
type CompletePart ¶
type CompletePart struct { XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Part" json:"-"` // Part number identifies the part. PartNumber int ETag string }
CompletePart sub container lists individual part numbers and their md5sum, part of completeMultipartUpload.
type ErrorResponse ¶
type ErrorResponse struct { XMLName xml.Name `xml:"Error" json:"-"` Code string Message string BucketName string Key string RequestID string `xml:"RequestId"` HostID string `xml:"HostId"` // Region where the bucket is located. This header is returned // only in HEAD bucket and ListObjects response. Region string // Underlying HTTP status code for the returned error StatusCode int `xml:"-" json:"-"` }
ErrorResponse - Is the typed error returned by all API operations. ErrorResponse struct should be comparable since it is compared inside golang http API (https://github.com/golang/go/issues/29768)
func ToErrorResponse ¶
func ToErrorResponse(err error) ErrorResponse
ToErrorResponse - Returns parsed ErrorResponse struct from body and http headers.
For example:
import s3 "github.com/minio/minio-go/v6" ... ... reader, stat, err := s3.GetObject(...) if err != nil { resp := s3.ToErrorResponse(err) } ...
type ListBucketResult ¶
type ListBucketResult struct { // A response can contain CommonPrefixes only if you have // specified a delimiter. CommonPrefixes []CommonPrefix // Metadata about each object returned. Contents []ObjectInfo Delimiter string // Encoding type used to encode object keys in the response. EncodingType string // A flag that indicates whether or not ListObjects returned all of the results // that satisfied the search criteria. IsTruncated bool Marker string MaxKeys int64 Name string // When response is truncated (the IsTruncated element value in // the response is true), you can use the key name in this field // as marker in the subsequent request to get next set of objects. // Object storage lists objects in alphabetical order Note: This // element is returned only if you have delimiter request // parameter specified. If response does not include the NextMaker // and it is truncated, you can use the value of the last Key in // the response as the marker in the subsequent request to get the // next set of object keys. NextMarker string Prefix string }
ListBucketResult container for listObjects response.
type ListBucketV2Result ¶
type ListBucketV2Result struct { // A response can contain CommonPrefixes only if you have // specified a delimiter. CommonPrefixes []CommonPrefix // Metadata about each object returned. Contents []ObjectInfo Delimiter string // Encoding type used to encode object keys in the response. EncodingType string // A flag that indicates whether or not ListObjects returned all of the results // that satisfied the search criteria. IsTruncated bool MaxKeys int64 Name string // Hold the token that will be sent in the next request to fetch the next group of keys NextContinuationToken string ContinuationToken string Prefix string // FetchOwner and StartAfter are currently not used FetchOwner string StartAfter string }
ListBucketV2Result container for listObjects response version 2.
type ListMultipartUploadsResult ¶
type ListMultipartUploadsResult struct { Bucket string KeyMarker string UploadIDMarker string `xml:"UploadIdMarker"` NextKeyMarker string NextUploadIDMarker string `xml:"NextUploadIdMarker"` EncodingType string MaxUploads int64 IsTruncated bool Uploads []ObjectMultipartInfo `xml:"Upload"` Prefix string Delimiter string // A response can contain CommonPrefixes only if you specify a delimiter. CommonPrefixes []CommonPrefix }
ListMultipartUploadsResult container for ListMultipartUploads response
type ListObjectPartsResult ¶
type ListObjectPartsResult struct { Bucket string Key string UploadID string `xml:"UploadId"` Initiator initiator Owner owner StorageClass string PartNumberMarker int NextPartNumberMarker int MaxParts int // Indicates whether the returned list of parts is truncated. IsTruncated bool ObjectParts []ObjectPart `xml:"Part"` EncodingType string }
ListObjectPartsResult container for ListObjectParts response.
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object represents an open object. It implements Reader, ReaderAt, Seeker, Closer for a HTTP stream.
func (*Object) Close ¶
Close - The behavior of Close after the first call returns error for subsequent Close() calls.
func (*Object) Read ¶
Read reads up to len(b) bytes into b. It returns the number of bytes read (0 <= n <= len(b)) and any error encountered. Returns io.EOF upon end of file.
func (*Object) ReadAt ¶
ReadAt reads len(b) bytes from the File starting at byte offset off. It returns the number of bytes read and the error, if any. ReadAt always returns a non-nil error when n < len(b). At end of file, that error is io.EOF.
func (*Object) Seek ¶
Seek sets the offset for the next Read or Write to offset, interpreted according to whence: 0 means relative to the origin of the file, 1 means relative to the current offset, and 2 means relative to the end. Seek returns the new offset and an error, if any.
Seeking to a negative offset is an error. Seeking to any positive offset is legal, subsequent io operations succeed until the underlying object is not closed.
func (*Object) Stat ¶
func (o *Object) Stat() (ObjectInfo, error)
Stat returns the ObjectInfo structure describing Object.
type ObjectInfo ¶
type ObjectInfo struct { // An ETag is optionally set to md5sum of an object. In case of multipart objects, // ETag is of the form MD5SUM-N where MD5SUM is md5sum of all individual md5sums of // each parts concatenated into one string. ETag string `json:"etag"` Key string `json:"name"` // Name of the object LastModified time.Time `json:"lastModified"` // Date and time the object was last modified. Size int64 `json:"size"` // Size in bytes of the object. ContentType string `json:"contentType"` // A standard MIME type describing the format of the object data. Expires time.Time `json:"expires"` // The date and time at which the object is no longer able to be cached. // Collection of additional metadata on the object. // eg: x-amz-meta-*, content-encoding etc. Metadata http.Header `json:"metadata" xml:"-"` // Owner name. Owner struct { DisplayName string `json:"name"` ID string `json:"id"` } `json:"owner"` // The class of storage used to store the object. StorageClass string `json:"storageClass"` // Error Err error `json:"-"` }
ObjectInfo container for object metadata.
type ObjectMultipartInfo ¶
type ObjectMultipartInfo struct { // Date and time at which the multipart upload was initiated. Initiated time.Time `type:"timestamp" timestampFormat:"iso8601"` Initiator initiator Owner owner // The type of storage to use for the object. Defaults to 'STANDARD'. StorageClass string // Key of the object for which the multipart upload was initiated. Key string // Size in bytes of the object. Size int64 // Upload ID that identifies the multipart upload. UploadID string `xml:"UploadId"` // Error Err error }
ObjectMultipartInfo container for multipart object metadata.
type ObjectPart ¶
type ObjectPart struct { // Part number identifies the part. PartNumber int // Date and time the part was uploaded. LastModified time.Time // Entity tag returned when the part was uploaded, usually md5sum // of the part. ETag string // Size of the uploaded part data. Size int64 }
ObjectPart container for particular part of an object.
type Options ¶
type Options struct { Creds *credentials.Credentials Secure bool Region string BucketLookup BucketLookupType }
Options for New method
type PostPolicy ¶
type PostPolicy struct {
// contains filtered or unexported fields
}
PostPolicy - Provides strict static type conversion and validation for Amazon S3's POST policy JSON string.
func (*PostPolicy) SetBucket ¶
func (p *PostPolicy) SetBucket(bucketName string) error
SetBucket - Sets bucket at which objects will be uploaded to.
func (*PostPolicy) SetContentLengthRange ¶
func (p *PostPolicy) SetContentLengthRange(min, max int64) error
SetContentLengthRange - Set new min and max content length condition for all incoming uploads.
func (*PostPolicy) SetContentType ¶
func (p *PostPolicy) SetContentType(contentType string) error
SetContentType - Sets content-type of the object for this policy based upload.
func (*PostPolicy) SetExpires ¶
func (p *PostPolicy) SetExpires(t time.Time) error
SetExpires - Sets expiration time for the new policy.
func (*PostPolicy) SetKey ¶
func (p *PostPolicy) SetKey(key string) error
SetKey - Sets an object name for the policy based upload.
func (*PostPolicy) SetKeyStartsWith ¶
func (p *PostPolicy) SetKeyStartsWith(keyStartsWith string) error
SetKeyStartsWith - Sets an object name that an policy based upload can start with.
func (*PostPolicy) SetSuccessStatusAction ¶
func (p *PostPolicy) SetSuccessStatusAction(status string) error
SetSuccessStatusAction - Sets the status success code of the object for this policy based upload.
func (*PostPolicy) SetUserData ¶
func (p *PostPolicy) SetUserData(key string, value string) error
SetUserData - Set user data as a key/value couple. Can be retrieved through a HEAD request or an event.
func (*PostPolicy) SetUserMetadata ¶
func (p *PostPolicy) SetUserMetadata(key string, value string) error
SetUserMetadata - Set user metadata as a key/value couple. Can be retrieved through a HEAD request or an event.
func (PostPolicy) String ¶
func (p PostPolicy) String() string
Stringer interface for printing policy in json formatted string.
type PutObjectOptions ¶
type PutObjectOptions struct { UserMetadata map[string]string Progress io.Reader ContentType string ContentEncoding string ContentDisposition string ContentLanguage string CacheControl string ServerSideEncryption encrypt.ServerSide NumThreads uint StorageClass string WebsiteRedirectLocation string PartSize uint64 }
PutObjectOptions represents options specified by user for PutObject call
func (PutObjectOptions) Header ¶
func (opts PutObjectOptions) Header() (header http.Header)
Header - constructs the headers from metadata entered by user in PutObjectOptions struct
type RemoveObjectError ¶
RemoveObjectError - container of Multi Delete S3 API error
Source Files ¶
- api-datatypes.go
- api-error-response.go
- api-get-object-file.go
- api-get-object.go
- api-get-policy.go
- api-list.go
- api-presigned.go
- api-put-bucket.go
- api-put-object-common.go
- api-put-object-copy.go
- api-put-object-file.go
- api-put-object-multipart.go
- api-put-object.go
- api-remove.go
- api-s3-datatypes.go
- api-stat.go
- api.go
- bucket-cache.go
- constants.go
- debug.go
- hook-reader.go
- post-policy.go
- retry.go
- s3-endpoints.go
- utils.go