Documentation ¶
Index ¶
- Constants
- Variables
- 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 ErrUnexpectedEOF(totalRead, totalSize int64, bucketName, objectName string) error
- type Arn
- type BucketInfo
- type BucketNotification
- func (b *BucketNotification) AddLambda(lambdaConfig NotificationConfig)
- func (b *BucketNotification) AddQueue(queueConfig NotificationConfig)
- func (b *BucketNotification) AddTopic(topicConfig NotificationConfig)
- func (b *BucketNotification) RemoveLambdaByArn(arn Arn)
- func (b *BucketNotification) RemoveQueueByArn(arn Arn)
- func (b *BucketNotification) RemoveTopicByArn(arn Arn)
- type Client
- func (c Client) BucketExists(bucketName string) (bool, error)
- func (c Client) CopyObject(bucketName string, objectName string, objectSource string, ...) error
- func (c Client) FGetObject(bucketName, objectName, filePath string) error
- func (c Client) FPutObject(bucketName, objectName, filePath, contentType string) (n int64, err error)
- func (c Client) GetBucketLocation(bucketName string) (string, error)
- func (c Client) GetBucketNotification(bucketName string) (bucketNotification BucketNotification, err error)
- func (c Client) GetBucketPolicy(bucketName, objectPrefix string) (bucketPolicy policy.BucketPolicy, err error)
- func (c Client) GetObject(bucketName, objectName string) (*Object, error)
- func (c Client) ListBucketPolicies(bucketName, objectPrefix string) (bucketPolicies map[string]policy.BucketPolicy, err 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) ListenBucketNotification(bucketName, prefix, suffix string, events []string, doneCh <-chan struct{}) <-chan NotificationInfo
- func (c Client) MakeBucket(bucketName string, location string) error
- func (c Client) PresignedGetObject(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, contentType string) (n int64, err error)
- func (c Client) PutObjectWithMetadata(bucketName, objectName string, reader io.Reader, metaData map[string][]string, ...) (n int64, err error)
- func (c Client) PutObjectWithProgress(bucketName, objectName string, reader io.Reader, contentType string, ...) (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) SetAppInfo(appName string, appVersion string)
- func (c Client) SetBucketNotification(bucketName string, bucketNotification BucketNotification) error
- func (c Client) SetBucketPolicy(bucketName string, objectPrefix string, bucketPolicy policy.BucketPolicy) error
- func (c *Client) SetCustomTransport(customHTTPTransport http.RoundTripper)
- func (c Client) StatObject(bucketName, objectName string) (ObjectInfo, error)
- func (c *Client) TraceOff()
- func (c *Client) TraceOn(outputStream io.Writer)
- type CopyConditions
- type ErrorResponse
- type Filter
- type FilterRule
- type LambdaConfig
- type NotificationConfig
- type NotificationEvent
- type NotificationEventType
- type NotificationInfo
- type Object
- type ObjectInfo
- type ObjectMultipartInfo
- 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) String() string
- type QueueConfig
- type RemoveObjectError
- type S3Key
- type SignatureType
- type TopicConfig
Constants ¶
const ( ObjectCreatedAll NotificationEventType = "s3:ObjectCreated:*" ObjectCreatePut = "s3:ObjectCreated:Put" ObjectCreatedPost = "s3:ObjectCreated:Post" ObjectCreatedCopy = "s3:ObjectCreated:Copy" ObjectCreatedCompleteMultipartUpload = "sh:ObjectCreated:CompleteMultipartUpload" ObjectRemovedAll = "s3:ObjectRemoved:*" ObjectRemovedDelete = "s3:ObjectRemoved:Delete" ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated" ObjectReducedRedundancyLostObject = "s3:ReducedRedundancyLostObject" )
The role of all event types are described in :
http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#notification-how-to-event-types-and-destinations
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 = 5
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 ¶ added in v1.0.0
ErrEntityTooLarge - Input size is larger than supported maximum.
func ErrEntityTooSmall ¶ added in v1.0.0
ErrEntityTooSmall - Input size is smaller than supported minimum.
func ErrInvalidArgument ¶ added in v1.0.0
ErrInvalidArgument - Invalid argument response.
func ErrInvalidBucketName ¶ added in v1.0.0
ErrInvalidBucketName - Invalid bucket name response.
func ErrInvalidObjectName ¶ added in v1.0.0
ErrInvalidObjectName - Invalid object name response.
func ErrNoSuchBucketPolicy ¶
ErrNoSuchBucketPolicy - No Such Bucket Policy response The specified bucket does not have a bucket policy.
func ErrUnexpectedEOF ¶ added in v1.0.0
ErrUnexpectedEOF - Unexpected end of file reached.
Types ¶
type Arn ¶
Arn - holds ARN information that will be sent to the web service, ARN desciption can be found in http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
type BucketInfo ¶ added in v1.0.0
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 BucketNotification ¶
type BucketNotification struct { XMLName xml.Name `xml:"NotificationConfiguration"` LambdaConfigs []LambdaConfig `xml:"CloudFunctionConfiguration"` TopicConfigs []TopicConfig `xml:"TopicConfiguration"` QueueConfigs []QueueConfig `xml:"QueueConfiguration"` }
BucketNotification - the struct that represents the whole XML to be sent to the web service
func (*BucketNotification) AddLambda ¶
func (b *BucketNotification) AddLambda(lambdaConfig NotificationConfig)
AddLambda adds a given lambda config to the general bucket notification config
func (*BucketNotification) AddQueue ¶
func (b *BucketNotification) AddQueue(queueConfig NotificationConfig)
AddQueue adds a given queue config to the general bucket notification config
func (*BucketNotification) AddTopic ¶
func (b *BucketNotification) AddTopic(topicConfig NotificationConfig)
AddTopic adds a given topic config to the general bucket notification config
func (*BucketNotification) RemoveLambdaByArn ¶
func (b *BucketNotification) RemoveLambdaByArn(arn Arn)
RemoveLambdaByArn removes all lambda configurations that match the exact specified ARN
func (*BucketNotification) RemoveQueueByArn ¶
func (b *BucketNotification) RemoveQueueByArn(arn Arn)
RemoveQueueByArn removes all queue configurations that match the exact specified ARN
func (*BucketNotification) RemoveTopicByArn ¶
func (b *BucketNotification) RemoveTopicByArn(arn Arn)
RemoveTopicByArn removes all topic configurations that match the exact specified ARN
type Client ¶ added in v1.0.0
type Client struct {
// contains filtered or unexported fields
}
Client implements Amazon S3 compatible methods.
func NewV2 ¶ added in v1.0.0
NewV2 - instantiate minio client with Amazon S3 signature version '2' compatibility.
func NewV4 ¶ added in v1.0.0
NewV4 - instantiate minio client with Amazon S3 signature version '4' compatibility.
func (Client) BucketExists ¶ added in v1.0.0
BucketExists verify if bucket exists and you have permission to access it.
func (Client) CopyObject ¶
func (c Client) CopyObject(bucketName string, objectName string, objectSource string, cpCond CopyConditions) error
CopyObject - copy a source object into a new object with the provided name in the provided bucket
func (Client) FGetObject ¶ added in v1.0.0
FGetObject - download contents of an object to a local file.
func (Client) FPutObject ¶ added in v1.0.0
func (c Client) FPutObject(bucketName, objectName, filePath, contentType string) (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) GetBucketNotification ¶
func (c Client) GetBucketNotification(bucketName string) (bucketNotification BucketNotification, err error)
GetBucketNotification - get bucket notification at a given path.
func (Client) GetBucketPolicy ¶
func (c Client) GetBucketPolicy(bucketName, objectPrefix string) (bucketPolicy policy.BucketPolicy, err error)
GetBucketPolicy - get bucket policy at a given path.
func (Client) ListBucketPolicies ¶
func (c Client) ListBucketPolicies(bucketName, objectPrefix string) (bucketPolicies map[string]policy.BucketPolicy, err error)
ListBucketPolicies - list all policies for a given prefix and all its children.
func (Client) ListBuckets ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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) // Recurively list all objects in 'mytestbucket' recursive := true for message := range api.ListObjectsV2("mytestbucket", "starthere", recursive, doneCh) { fmt.Println(message) }
func (Client) ListenBucketNotification ¶
func (c Client) ListenBucketNotification(bucketName, prefix, suffix string, events []string, doneCh <-chan struct{}) <-chan NotificationInfo
ListenBucketNotification - listen on bucket notifications.
func (Client) MakeBucket ¶ added in v1.0.0
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) PresignedGetObject ¶ added in v1.0.0
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 without credentials. Expires maximum is 7days - ie. 604800 and minimum is 1. Additionally you can override a set of response headers using the query parameters.
func (Client) PresignedPostPolicy ¶ added in v1.0.0
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 ¶ added in v1.0.0
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. Expires maximum is 7days - ie. 604800 and minimum is 1.
func (Client) PutObject ¶ added in v1.0.0
func (c Client) PutObject(bucketName, objectName string, reader io.Reader, contentType string) (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 5MiB PutObject automatically does a single atomic Put operation.
- For size larger than 5MiB PutObject automatically does a resumable 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.
NOTE: Google Cloud Storage does not implement Amazon S3 Compatible multipart PUT. So we fall back to single PUT operation with the maximum limit of 5GiB.
NOTE: For anonymous requests Amazon S3 doesn't allow multipart upload. So we fall back to single PUT operation.
func (Client) PutObjectWithMetadata ¶
func (c Client) PutObjectWithMetadata(bucketName, objectName string, reader io.Reader, metaData map[string][]string, progress io.Reader) (n int64, err error)
PutObjectWithMetadata - with metadata.
func (Client) PutObjectWithProgress ¶ added in v1.0.0
func (c Client) PutObjectWithProgress(bucketName, objectName string, reader io.Reader, contentType string, progress io.Reader) (n int64, err error)
PutObjectWithProgress - with progress.
func (Client) RemoveAllBucketNotification ¶
RemoveAllBucketNotification - Remove bucket notification clears all previously specified config
func (Client) RemoveBucket ¶ added in v1.0.0
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 ¶ added in v1.0.0
RemoveIncompleteUpload aborts an partially uploaded object. Requires explicit authentication, no anonymous requests are allowed for multipart API.
func (Client) RemoveObject ¶ added in v1.0.0
RemoveObject remove an object from a bucket.
func (Client) RemoveObjects ¶
func (c Client) RemoveObjects(bucketName string, objectsCh <-chan string) <-chan RemoveObjectError
RemoveObjects remove multiples objects from a bucket. The list of objects to remove are received from objectsCh. Remove failures are sent back via error channel.
func (*Client) SetAppInfo ¶ added in v1.0.0
SetAppInfo - add application details to user agent.
func (Client) SetBucketNotification ¶
func (c Client) SetBucketNotification(bucketName string, bucketNotification BucketNotification) error
SetBucketNotification saves a new bucket notification.
func (Client) SetBucketPolicy ¶
func (c Client) SetBucketPolicy(bucketName string, objectPrefix string, bucketPolicy policy.BucketPolicy) error
SetBucketPolicy set the access permissions on an existing bucket.
For example
none - owner gets full access [default]. readonly - anonymous get access for everyone at a given object prefix. readwrite - anonymous list/put/delete access to a given object prefix. writeonly - anonymous put/delete access to a given object prefix.
func (*Client) SetCustomTransport ¶ added in v1.0.0
func (c *Client) SetCustomTransport(customHTTPTransport http.RoundTripper)
SetCustomTransport - set new custom transport.
func (Client) StatObject ¶ added in v1.0.0
func (c Client) StatObject(bucketName, objectName string) (ObjectInfo, error)
StatObject verifies if object exists and you have permission to access.
type CopyConditions ¶
type CopyConditions struct {
// contains filtered or unexported fields
}
CopyConditions - copy conditions.
func NewCopyConditions ¶
func NewCopyConditions() CopyConditions
NewCopyConditions - Instantiate new list of conditions.
func (*CopyConditions) SetMatchETag ¶
func (c *CopyConditions) SetMatchETag(etag string) error
SetMatchETag - set match etag.
func (*CopyConditions) SetMatchETagExcept ¶
func (c *CopyConditions) SetMatchETagExcept(etag string) error
SetMatchETagExcept - set match etag except.
func (*CopyConditions) SetModified ¶
func (c *CopyConditions) SetModified(modTime time.Time) error
SetModified - set modified time since.
func (*CopyConditions) SetUnmodified ¶
func (c *CopyConditions) SetUnmodified(modTime time.Time) error
SetUnmodified - set unmodified time since.
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 }
ErrorResponse - Is the typed error returned by all API operations.
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" ... ... reader, stat, err := s3.GetObject(...) if err != nil { resp := s3.ToErrorResponse(err) } ...
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
Error - Returns HTTP error string
type Filter ¶
type Filter struct {
S3Key S3Key `xml:"S3Key,omitempty"`
}
Filter - a tag in the notification xml structure which carries suffix/prefix filters
type FilterRule ¶
FilterRule - child of S3Key, a tag in the notification xml which carries suffix/prefix filters
type LambdaConfig ¶
type LambdaConfig struct { NotificationConfig Lambda string `xml:"CloudFunction"` }
LambdaConfig carries one single cloudfunction notification configuration
type NotificationConfig ¶
type NotificationConfig struct { ID string `xml:"Id,omitempty"` Arn Arn `xml:"-"` Events []NotificationEventType `xml:"Event"` Filter *Filter `xml:"Filter,omitempty"` }
NotificationConfig - represents one single notification configuration such as topic, queue or lambda configuration.
func NewNotificationConfig ¶
func NewNotificationConfig(arn Arn) NotificationConfig
NewNotificationConfig creates one notification config and sets the given ARN
func (*NotificationConfig) AddEvents ¶
func (t *NotificationConfig) AddEvents(events ...NotificationEventType)
AddEvents adds one event to the current notification config
func (*NotificationConfig) AddFilterPrefix ¶
func (t *NotificationConfig) AddFilterPrefix(prefix string)
AddFilterPrefix sets the prefix configuration to the current notification config
func (*NotificationConfig) AddFilterSuffix ¶
func (t *NotificationConfig) AddFilterSuffix(suffix string)
AddFilterSuffix sets the suffix configuration to the current notification config
type NotificationEvent ¶
type NotificationEvent struct { EventVersion string `json:"eventVersion"` EventSource string `json:"eventSource"` AwsRegion string `json:"awsRegion"` EventTime string `json:"eventTime"` EventName string `json:"eventName"` UserIdentity identity `json:"userIdentity"` RequestParameters map[string]string `json:"requestParameters"` ResponseElements map[string]string `json:"responseElements"` S3 eventMeta `json:"s3"` }
NotificationEvent represents an Amazon an S3 bucket notification event.
type NotificationEventType ¶
type NotificationEventType string
NotificationEventType is a S3 notification event associated to the bucket notification configuration
type NotificationInfo ¶
type NotificationInfo struct { Records []NotificationEvent Err error }
NotificationInfo - represents the collection of notification events, additionally also reports errors if any while listening on bucket notifications.
type Object ¶ added in v1.0.0
type Object struct {
// contains filtered or unexported fields
}
Object represents an open object. It implements Read, ReadAt, Seeker, Close for a HTTP stream.
func (*Object) Close ¶ added in v1.0.0
Close - The behavior of Close after the first call returns error for subsequent Close() calls.
func (*Object) Read ¶ added in v1.0.0
Read reads up to len(b) bytes into b. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Returns io.EOF upon end of file.
func (*Object) ReadAt ¶ added in v1.0.0
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (o *Object) Stat() (ObjectInfo, error)
Stat returns the ObjectInfo structure describing Object.
type ObjectInfo ¶ added in v1.0.0
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. // Collection of additional metadata on the object. // eg: x-amz-meta-*, content-encoding etc. Metadata http.Header `json:"metadata"` // 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 ¶ added in v1.0.0
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 PostPolicy ¶ added in v1.0.0
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 NewPostPolicy ¶ added in v1.0.0
func NewPostPolicy() *PostPolicy
NewPostPolicy - Instantiate new post policy.
func (*PostPolicy) SetBucket ¶ added in v1.0.0
func (p *PostPolicy) SetBucket(bucketName string) error
SetBucket - Sets bucket at which objects will be uploaded to.
func (*PostPolicy) SetContentLengthRange ¶ added in v1.0.0
func (p *PostPolicy) SetContentLengthRange(min, max int64) error
SetContentLengthRange - Set new min and max content length condition for all incoming uploads.
func (*PostPolicy) SetContentType ¶ added in v1.0.0
func (p *PostPolicy) SetContentType(contentType string) error
SetContentType - Sets content-type of the object for this policy based upload.
func (*PostPolicy) SetExpires ¶ added in v1.0.0
func (p *PostPolicy) SetExpires(t time.Time) error
SetExpires - Sets expiration time for the new policy.
func (*PostPolicy) SetKey ¶ added in v1.0.0
func (p *PostPolicy) SetKey(key string) error
SetKey - Sets an object name for the policy based upload.
func (*PostPolicy) SetKeyStartsWith ¶ added in v1.0.0
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) String ¶ added in v1.0.0
func (p PostPolicy) String() string
Stringer interface for printing policy in json formatted string.
type QueueConfig ¶
type QueueConfig struct { NotificationConfig Queue string `xml:"Queue"` }
QueueConfig carries one single queue notification configuration
type RemoveObjectError ¶
RemoveObjectError - container of Multi Delete S3 API error
type S3Key ¶
type S3Key struct {
FilterRules []FilterRule `xml:"FilterRule,omitempty"`
}
S3Key - child of Filter, a tag in the notification xml which carries suffix/prefix filters
type SignatureType ¶ added in v1.0.0
type SignatureType int
SignatureType is type of Authorization requested for a given HTTP request.
const ( Latest SignatureType = iota SignatureV4 SignatureV2 )
Different types of supported signatures - default is Latest i.e SignatureV4.
type TopicConfig ¶
type TopicConfig struct { NotificationConfig Topic string `xml:"Topic"` }
TopicConfig carries one single topic notification configuration
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-notification.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-progress.go
- api-put-object-readat.go
- api-put-object.go
- api-remove.go
- api-s3-datatypes.go
- api-stat.go
- api.go
- bucket-cache.go
- bucket-notification.go
- constants.go
- copy-conditions.go
- hook-reader.go
- post-policy.go
- retry-continous.go
- retry.go
- s3-endpoints.go
- signature-type.go
- tempfile.go
- utils.go