Documentation ¶
Index ¶
- Constants
- Variables
- func CRC64Combine(crc1 uint64, crc2 uint64, len2 uint64) uint64
- func Code(err error) string
- func GetUnixTimeMs() int64
- func Int64(value int64) *int64
- func IsValidBucketName(name string) error
- func LookupIP(ctx context.Context, host string) ([]net.IP, error)
- func MinDuration(t1, t2 time.Duration) time.Duration
- func NewCRC(tab *crc64.Table, init uint64) hash.Hash64
- func OnRetryFromStart(req *Request) error
- func RequestID(err error) string
- func SigningKey(info *SigningKeyInfo) []byte
- func StatueCode(err error) intdeprecated
- func StatusCode(err error) int
- func StringPtr(input string) *string
- func SupportedEndpoint() map[string]string
- func SupportedRegion() map[string]string
- func ToMillis(t time.Time) int64
- func URIEncode(in string, encodeSlash bool) []byte
- func UTCNow() time.Time
- type AbortInCompleteMultipartUpload
- type AbortMultipartUploadInput
- type AbortMultipartUploadOutput
- type AccessLogConfiguration
- type AppendObjectOutput
- type AppendObjectV2Input
- type AppendObjectV2Output
- type ApplyServerSideEncryptionByDefault
- type Bucket
- func (bkt *Bucket) AbortMultipartUpload(ctx context.Context, input *AbortMultipartUploadInput, options ...Option) (*AbortMultipartUploadOutput, error)deprecated
- func (bkt *Bucket) AppendObject(ctx context.Context, objectKey string, content io.Reader, offset int64, ...) (*AppendObjectOutput, error)deprecated
- func (bkt *Bucket) CompleteMultipartUpload(ctx context.Context, input *CompleteMultipartUploadInput, options ...Option) (*CompleteMultipartUploadOutput, error)deprecated
- func (bkt *Bucket) CopyObject(ctx context.Context, srcObjectKey, dstObjectKey string, options ...Option) (*CopyObjectOutput, error)deprecated
- func (bkt *Bucket) CopyObjectFrom(ctx context.Context, srcBucket, srcObjectKey, dstObjectKey string, ...) (*CopyObjectOutput, error)deprecated
- func (bkt *Bucket) CopyObjectTo(ctx context.Context, dstBucket, dstObjectKey, srcObjectKey string, ...) (*CopyObjectOutput, error)deprecated
- func (bkt *Bucket) CreateMultipartUpload(ctx context.Context, objectKey string, options ...Option) (*CreateMultipartUploadOutput, error)deprecated
- func (bkt *Bucket) DeleteMultiObjects(ctx context.Context, input *DeleteMultiObjectsInput, options ...Option) (*DeleteMultiObjectsOutput, error)deprecated
- func (bkt *Bucket) DeleteObject(ctx context.Context, objectKey string, options ...Option) (*DeleteObjectOutput, error)deprecated
- func (bkt *Bucket) DeleteObjectTagging(ctx context.Context, input *DeleteObjectTaggingInput, option ...Option) (*DeleteObjectTaggingOutput, error)
- func (bkt *Bucket) FetchObject(ctx context.Context, input *FetchObjectInput, options ...Option) (*FetchObjectOutput, error)
- func (bkt *Bucket) GetFetchTask(ctx context.Context, input *GetFetchTaskInput, options ...Option) (*GetFetchTaskOutput, error)
- func (bkt *Bucket) GetObject(ctx context.Context, objectKey string, options ...Option) (*GetObjectOutput, error)deprecated
- func (bkt *Bucket) GetObjectAcl(ctx context.Context, objectKey string, options ...Option) (*GetObjectAclOutput, error)deprecated
- func (bkt *Bucket) GetObjectTagging(ctx context.Context, input *GetObjectTaggingInput, option ...Option) (*GetObjectTaggingOutput, error)
- func (bkt *Bucket) GetSymlink(ctx context.Context, input *GetSymlinkInput, option ...Option) (*GetSymlinkOutput, error)
- func (bkt *Bucket) HeadObject(ctx context.Context, objectKey string, options ...Option) (*HeadObjectOutput, error)deprecated
- func (bkt *Bucket) ListMultipartUploads(ctx context.Context, input *ListMultipartUploadsInput, options ...Option) (*ListMultipartUploadsOutput, error)deprecated
- func (bkt *Bucket) ListObjectVersions(ctx context.Context, input *ListObjectVersionsInput, options ...Option) (*ListObjectVersionsOutput, error)deprecated
- func (bkt *Bucket) ListObjects(ctx context.Context, input *ListObjectsInput, options ...Option) (*ListObjectsOutput, error)deprecated
- func (bkt *Bucket) ListUploadedParts(ctx context.Context, input *ListUploadedPartsInput, options ...Option) (*ListUploadedPartsOutput, error)deprecated
- func (bkt *Bucket) PutFetchTask(ctx context.Context, input *PutFetchTaskInput, options ...Option) (*PutFetchTaskOutput, error)
- func (bkt *Bucket) PutObject(ctx context.Context, objectKey string, content io.Reader, options ...Option) (*PutObjectOutput, error)deprecated
- func (bkt *Bucket) PutObjectAcl(ctx context.Context, input *PutObjectAclInput, options ...Option) (*PutObjectAclOutput, error)deprecated
- func (bkt *Bucket) PutObjectTagging(ctx context.Context, input *PutObjectTaggingInput, option ...Option) (*PutObjectTaggingOutput, error)
- func (bkt *Bucket) PutSymlink(ctx context.Context, input *PutSymlinkInput, option ...Option) (*PutSymlinkOutput, error)
- func (bkt *Bucket) RestoreObject(ctx context.Context, input *RestoreObjectInput, option ...Option) (*RestoreObjectOutput, error)
- func (bkt *Bucket) SetObjectMeta(ctx context.Context, objectKey string, options ...Option) (*SetObjectMetaOutput, error)deprecated
- func (bkt *Bucket) UploadPart(ctx context.Context, input *UploadPartInput, options ...Option) (*UploadPartOutput, error)deprecated
- func (bkt *Bucket) UploadPartCopy(ctx context.Context, input *UploadPartCopyInput, options ...Option) (*UploadPartCopyOutput, error)deprecated
- type BucketEncryptionRule
- type BucketPolicy
- type CancelHook
- type ChecksumError
- type Clientdeprecated
- func (cli *Client) Bucket(bucket string) (*Bucket, error)deprecated
- func (cli *Client) CreateBucket(ctx context.Context, input *CreateBucketInput) (*CreateBucketOutput, error)deprecated
- func (cli *Client) DeleteBucket(ctx context.Context, bucket string) (*DeleteBucketOutput, error)deprecated
- func (cli *Client) DeleteBucketPolicy(ctx context.Context, bucket string) (*DeleteBucketPolicyOutput, error)
- func (cli *Client) GetBucketACL(ctx context.Context, input *GetBucketACLInput, option ...Option) (*GetBucketACLOutput, error)
- func (cli *Client) GetBucketPolicy(ctx context.Context, bucket string) (*GetBucketPolicyOutput, error)
- func (cli *Client) GetBucketVersioning(ctx context.Context, bucket string) (*GetBucketVersioningOutput, error)
- func (cli *Client) HeadBucket(ctx context.Context, bucket string, option ...Option) (*HeadBucketOutput, error)deprecated
- func (cli *Client) ListBuckets(ctx context.Context, _ *ListBucketsInput) (*ListBucketsOutput, error)deprecated
- func (cli *Client) PreSignedURL(httpMethod string, bucket, objectKey string, ttl time.Duration, ...) (string, error)
- func (cli *Client) PutBucketACL(ctx context.Context, input *PutBucketACLInput, option ...Option) (*PutBucketACLOutput, error)
- func (cli *Client) PutBucketPolicy(ctx context.Context, bucket string, policy *BucketPolicy) (*PutBucketPolicyOutput, error)
- type ClientOption
- func WithAutoRecognizeContentType(enable bool) ClientOption
- func WithConnectionTimeout(timeout time.Duration) ClientOption
- func WithContentTypeRecognizer(recognizer ContentTypeRecognizer) ClientOption
- func WithCredentials(credentials Credentials) ClientOption
- func WithCustomDomain(isCustomDomain bool) ClientOption
- func WithDNSCacheTime(dnsCacheTime int) ClientOption
- func WithDisableEncodingMeta(disable bool) ClientOption
- func WithEnableCRC(enableCRC bool) ClientOption
- func WithEnableVerifySSL(enable bool) ClientOption
- func WithExcept100ContinueThreshold(threshold int64) ClientOption
- func WithHTTPTransport(transport http.RoundTripper) ClientOption
- func WithHighLatencyLogThreshold(highLatencyLogThreshold int) ClientOption
- func WithIdleConnTimeout(timeout time.Duration) ClientOption
- func WithLogger(logger Logger) ClientOption
- func WithMaxConnections(max int) ClientOption
- func WithMaxRetryCount(retryCount int) ClientOption
- func WithPathAccessMode(pathAccessMode bool) ClientOptiondeprecated
- func WithProxy(proxy *Proxy) ClientOption
- func WithRegion(region string) ClientOption
- func WithRequestTimeout(timeout time.Duration) ClientOption
- func WithSigner(signer Signer) ClientOption
- func WithSocketTimeout(readTimeout, writeTimeout time.Duration) ClientOption
- func WithTransport(transport Transport) ClientOptiondeprecated
- func WithTransportConfig(config *TransportConfig) ClientOption
- func WithUserAgentSuffix(suffix string) ClientOption
- type ClientV2
- func (cli *ClientV2) AbortMultipartUpload(ctx context.Context, input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error)
- func (cli *ClientV2) AppendObjectV2(ctx context.Context, input *AppendObjectV2Input) (*AppendObjectV2Output, error)
- func (cli *ClientV2) Close()
- func (cli *ClientV2) CompleteMultipartUploadV2(ctx context.Context, input *CompleteMultipartUploadV2Input) (*CompleteMultipartUploadV2Output, error)
- func (cli *ClientV2) CopyObject(ctx context.Context, input *CopyObjectInput) (*CopyObjectOutput, error)
- func (cli *ClientV2) CreateBucketV2(ctx context.Context, input *CreateBucketV2Input) (*CreateBucketV2Output, error)
- func (cli *ClientV2) CreateMultipartUploadV2(ctx context.Context, input *CreateMultipartUploadV2Input) (*CreateMultipartUploadV2Output, error)
- func (cli *ClientV2) DeleteBucket(ctx context.Context, input *DeleteBucketInput) (*DeleteBucketOutput, error)
- func (cli *ClientV2) DeleteBucketCORS(ctx context.Context, input *DeleteBucketCORSInput) (*DeleteBucketCORSOutput, error)
- func (cli *ClientV2) DeleteBucketCustomDomain(ctx context.Context, input *DeleteBucketCustomDomainInput) (*DeleteBucketCustomDomainOutput, error)
- func (cli *ClientV2) DeleteBucketEncryption(ctx context.Context, input *DeleteBucketEncryptionInput) (*DeleteBucketEncryptionOutput, error)
- func (cli *ClientV2) DeleteBucketLifecycle(ctx context.Context, input *DeleteBucketLifecycleInput) (*DeleteBucketLifecycleOutput, error)
- func (cli *ClientV2) DeleteBucketMirrorBack(ctx context.Context, input *DeleteBucketMirrorBackInput) (*DeleteBucketMirrorBackOutput, error)
- func (cli *ClientV2) DeleteBucketPolicyV2(ctx context.Context, input *DeleteBucketPolicyV2Input) (*DeleteBucketPolicyV2Output, error)
- func (cli *ClientV2) DeleteBucketRealTimeLog(ctx context.Context, input *DeleteBucketRealTimeLogInput) (*DeleteBucketRealTimeLogOutput, error)
- func (cli *ClientV2) DeleteBucketRename(ctx context.Context, input *DeleteBucketRenameInput) (*DeleteBucketRenameOutput, error)
- func (cli *ClientV2) DeleteBucketReplication(ctx context.Context, input *DeleteBucketReplicationInput) (*DeleteBucketReplicationOutput, error)
- func (cli *ClientV2) DeleteBucketTagging(ctx context.Context, input *DeleteBucketTaggingInput) (*DeleteBucketTaggingOutput, error)
- func (cli *ClientV2) DeleteBucketWebsite(ctx context.Context, input *DeleteBucketWebsiteInput) (*DeleteBucketWebsiteOutput, error)
- func (cli *ClientV2) DeleteMultiObjects(ctx context.Context, input *DeleteMultiObjectsInput) (*DeleteMultiObjectsOutput, error)
- func (cli *ClientV2) DeleteObjectTagging(ctx context.Context, input *DeleteObjectTaggingInput) (*DeleteObjectTaggingOutput, error)
- func (cli *ClientV2) DeleteObjectV2(ctx context.Context, input *DeleteObjectV2Input) (*DeleteObjectV2Output, error)
- func (cli *ClientV2) DownloadFile(ctx context.Context, input *DownloadFileInput) (*DownloadFileOutput, error)
- func (cli *ClientV2) FetchObjectV2(ctx context.Context, input *FetchObjectInputV2) (*FetchObjectOutputV2, error)
- func (cli *ClientV2) GetBucketACL(ctx context.Context, input *GetBucketACLInput) (*GetBucketACLOutput, error)
- func (cli *ClientV2) GetBucketCORS(ctx context.Context, input *GetBucketCORSInput) (*GetBucketCORSOutput, error)
- func (cli *ClientV2) GetBucketEncryption(ctx context.Context, input *GetBucketEncryptionInput) (*GetBucketEncryptionOutput, error)
- func (cli *ClientV2) GetBucketLifecycle(ctx context.Context, input *GetBucketLifecycleInput) (*GetBucketLifecycleOutput, error)
- func (cli *ClientV2) GetBucketLocation(ctx context.Context, input *GetBucketLocationInput) (*GetBucketLocationOutput, error)
- func (cli *ClientV2) GetBucketMirrorBack(ctx context.Context, input *GetBucketMirrorBackInput) (*GetBucketMirrorBackOutput, error)
- func (cli *ClientV2) GetBucketNotification(ctx context.Context, input *GetBucketNotificationInput) (*GetBucketNotificationOutput, error)
- func (cli *ClientV2) GetBucketNotificationType2(ctx context.Context, input *GetBucketNotificationType2Input) (*GetBucketNotificationType2Output, error)
- func (cli *ClientV2) GetBucketPolicyV2(ctx context.Context, input *GetBucketPolicyV2Input) (*GetBucketPolicyV2Output, error)
- func (cli *ClientV2) GetBucketRealTimeLog(ctx context.Context, input *GetBucketRealTimeLogInput) (*GetBucketRealTimeLogOutput, error)
- func (cli *ClientV2) GetBucketRename(ctx context.Context, input *GetBucketRenameInput) (*GetBucketRenameOutput, error)
- func (cli *ClientV2) GetBucketReplication(ctx context.Context, input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error)
- func (cli *ClientV2) GetBucketTagging(ctx context.Context, input *GetBucketTaggingInput) (*GetBucketTaggingOutput, error)
- func (cli *ClientV2) GetBucketVersioning(ctx context.Context, input *GetBucketVersioningInput) (*GetBucketVersioningOutputV2, error)
- func (cli *ClientV2) GetBucketWebsite(ctx context.Context, input *GetBucketWebsiteInput) (*GetBucketWebsiteOutput, error)
- func (cli *ClientV2) GetFileStatus(ctx context.Context, input *GetFileStatusInput) (*GetFileStatusOutput, error)
- func (cli *ClientV2) GetObjectACL(ctx context.Context, input *GetObjectACLInput) (*GetObjectACLOutput, error)
- func (cli *ClientV2) GetObjectTagging(ctx context.Context, input *GetObjectTaggingInput) (*GetObjectTaggingOutput, error)
- func (cli *ClientV2) GetObjectToFile(ctx context.Context, input *GetObjectToFileInput) (*GetObjectToFileOutput, error)
- func (cli *ClientV2) GetObjectV2(ctx context.Context, input *GetObjectV2Input) (*GetObjectV2Output, error)
- func (cli *ClientV2) GetSymlink(ctx context.Context, input *GetSymlinkInput) (*GetSymlinkOutput, error)
- func (cli *ClientV2) HeadBucket(ctx context.Context, input *HeadBucketInput) (*HeadBucketOutput, error)
- func (cli *ClientV2) HeadObjectV2(ctx context.Context, input *HeadObjectV2Input) (*HeadObjectV2Output, error)
- func (cli *ClientV2) ListBucketCustomDomain(ctx context.Context, input *ListBucketCustomDomainInput) (*ListBucketCustomDomainOutput, error)
- func (cli *ClientV2) ListBuckets(ctx context.Context, input *ListBucketsInput) (*ListBucketsOutput, error)
- func (cli *ClientV2) ListMultipartUploadsV2(ctx context.Context, input *ListMultipartUploadsV2Input) (*ListMultipartUploadsV2Output, error)
- func (cli *ClientV2) ListObjectVersionsV2(ctx context.Context, input *ListObjectVersionsV2Input) (*ListObjectVersionsV2Output, error)
- func (cli *ClientV2) ListObjectsType2(ctx context.Context, input *ListObjectsType2Input) (*ListObjectsType2Output, error)
- func (cli *ClientV2) ListObjectsV2(ctx context.Context, input *ListObjectsV2Input) (*ListObjectsV2Output, error)
- func (cli *ClientV2) ListParts(ctx context.Context, input *ListPartsInput) (*ListPartsOutput, error)
- func (cli *ClientV2) PreSignedPolicyURL(ctx context.Context, input *PreSingedPolicyURLInput) (*PreSingedPolicyURLOutput, error)
- func (cli *ClientV2) PreSignedPostSignature(ctx context.Context, input *PreSingedPostSignatureInput) (*PreSingedPostSignatureOutput, error)
- func (cli *ClientV2) PreSignedURL(input *PreSignedURLInput) (*PreSignedURLOutput, error)
- func (cli *ClientV2) PutBucketACL(ctx context.Context, input *PutBucketACLInput) (*PutBucketACLOutput, error)
- func (cli *ClientV2) PutBucketCORS(ctx context.Context, input *PutBucketCORSInput) (*PutBucketCORSOutput, error)
- func (cli *ClientV2) PutBucketCustomDomain(ctx context.Context, input *PutBucketCustomDomainInput) (*PutBucketCustomDomainOutput, error)
- func (cli *ClientV2) PutBucketEncryption(ctx context.Context, input *PutBucketEncryptionInput) (*PutBucketEncryptionOutput, error)
- func (cli *ClientV2) PutBucketLifecycle(ctx context.Context, input *PutBucketLifecycleInput) (*PutLifecycleOutput, error)
- func (cli *ClientV2) PutBucketMirrorBack(ctx context.Context, input *PutBucketMirrorBackInput) (*PutBucketMirrorBackOutput, error)
- func (cli *ClientV2) PutBucketNotification(ctx context.Context, input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error)
- func (cli *ClientV2) PutBucketNotificationType2(ctx context.Context, input *PutBucketNotificationType2Input) (*PutBucketNotificationType2Output, error)
- func (cli *ClientV2) PutBucketPolicyV2(ctx context.Context, input *PutBucketPolicyV2Input) (*PutBucketPolicyV2Output, error)
- func (cli *ClientV2) PutBucketRealTimeLog(ctx context.Context, input *PutBucketRealTimeLogInput) (*PutBucketRealTimeLogOutput, error)
- func (cli *ClientV2) PutBucketRename(ctx context.Context, input *PutBucketRenameInput) (*PutBucketRenameOutput, error)
- func (cli *ClientV2) PutBucketReplication(ctx context.Context, input *PutBucketReplicationInput) (*PutBucketReplicationOutput, error)
- func (cli *ClientV2) PutBucketStorageClass(ctx context.Context, input *PutBucketStorageClassInput) (*PutBucketStorageClassOutput, error)
- func (cli *ClientV2) PutBucketTagging(ctx context.Context, input *PutBucketTaggingInput) (*PutBucketTaggingOutput, error)
- func (cli *ClientV2) PutBucketVersioning(ctx context.Context, input *PutBucketVersioningInput) (*PutBucketVersioningOutput, error)
- func (cli *ClientV2) PutBucketWebsite(ctx context.Context, input *PutBucketWebsiteInput) (*PutBucketWebsiteOutput, error)
- func (cli *ClientV2) PutFetchTaskV2(ctx context.Context, input *PutFetchTaskInputV2) (*PutFetchTaskOutputV2, error)
- func (cli *ClientV2) PutObjectACL(ctx context.Context, input *PutObjectACLInput) (*PutObjectACLOutput, error)
- func (cli *ClientV2) PutObjectFromFile(ctx context.Context, input *PutObjectFromFileInput) (*PutObjectFromFileOutput, error)
- func (cli *ClientV2) PutObjectTagging(ctx context.Context, input *PutObjectTaggingInput) (*PutObjectTaggingOutput, error)
- func (cli *ClientV2) PutObjectV2(ctx context.Context, input *PutObjectV2Input) (*PutObjectV2Output, error)
- func (cli *ClientV2) PutSymlink(ctx context.Context, input *PutSymlinkInput) (*PutSymlinkOutput, error)
- func (cli *ClientV2) RenameObject(ctx context.Context, input *RenameObjectInput) (*RenameObjectOutput, error)
- func (cli *ClientV2) RestoreObject(ctx context.Context, input *RestoreObjectInput) (*RestoreObjectOutput, error)
- func (cli *ClientV2) ResumableCopyObject(ctx context.Context, input *ResumableCopyObjectInput) (*ResumableCopyObjectOutput, error)
- func (cli *ClientV2) SetHTTPTransport(transport http.RoundTripper)
- func (cli *ClientV2) SetObjectMeta(ctx context.Context, input *SetObjectMetaInput) (*SetObjectMetaOutput, error)
- func (cli *ClientV2) UploadFile(ctx context.Context, input *UploadFileInput) (output *UploadFileOutput, err error)
- func (cli *ClientV2) UploadPartCopyV2(ctx context.Context, input *UploadPartCopyV2Input) (*UploadPartCopyV2Output, error)
- func (cli *ClientV2) UploadPartFromFile(ctx context.Context, input *UploadPartFromFileInput) (*UploadPartFromFileOutput, error)
- func (cli *ClientV2) UploadPartV2(ctx context.Context, input *UploadPartV2Input) (*UploadPartV2Output, error)
- type CloudFunctionConfiguration
- type CommonHeaders
- type CommonSourceEndpoint
- type CompleteMultipartUploadInput
- type CompleteMultipartUploadOutput
- type CompleteMultipartUploadV2Input
- type CompleteMultipartUploadV2Output
- type Condition
- type Config
- type ContentLengthRange
- type ContentTypeRecognizer
- type CopyEvent
- type CopyEventListener
- type CopyObjectInput
- type CopyObjectOutput
- type CopyPartInfo
- type CopySource
- type CorsRule
- type CreateBucketInput
- type CreateBucketOutput
- type CreateBucketV2Input
- type CreateBucketV2Output
- type CreateMultipartUploadOutput
- type CreateMultipartUploadV2Input
- type CreateMultipartUploadV2Output
- type Credential
- type CredentialProvider
- type Credentials
- type CustomDomainRule
- type CustomMeta
- type DataTransferListener
- type DataTransferStatus
- type DefaultTransport
- type DeleteBucketCORSInput
- type DeleteBucketCORSOutput
- type DeleteBucketCustomDomainInput
- type DeleteBucketCustomDomainOutput
- type DeleteBucketEncryptionInput
- type DeleteBucketEncryptionOutput
- type DeleteBucketInput
- type DeleteBucketLifecycleInput
- type DeleteBucketLifecycleOutput
- type DeleteBucketMirrorBackInput
- type DeleteBucketMirrorBackOutput
- type DeleteBucketOutput
- type DeleteBucketPolicyOutput
- type DeleteBucketPolicyV2Input
- type DeleteBucketPolicyV2Output
- type DeleteBucketRealTimeLogInput
- type DeleteBucketRealTimeLogOutput
- type DeleteBucketRenameInput
- type DeleteBucketRenameOutput
- type DeleteBucketReplicationInput
- type DeleteBucketReplicationOutput
- type DeleteBucketTaggingInput
- type DeleteBucketTaggingOutput
- type DeleteBucketWebsiteInput
- type DeleteBucketWebsiteOutput
- type DeleteError
- type DeleteMultiObjectsInput
- type DeleteMultiObjectsOutput
- type DeleteObjectOutput
- type DeleteObjectTaggingInput
- type DeleteObjectTaggingOutput
- type DeleteObjectV2Input
- type DeleteObjectV2Output
- type Deleted
- type DeletedV2
- type Destination
- type DestinationRocketMQ
- type DestinationVeFaaS
- type DownloadEvent
- type DownloadEventListener
- type DownloadFileInput
- type DownloadFileOutput
- type DownloadPartInfo
- type ETagCheckReadCloser
- type EmptyContentTypeRecognizer
- type EndpointCredentialProvider
- type Error
- type ErrorDocument
- type Expiration
- type ExtensionBasedContentTypeRecognizer
- type FederationCredentials
- type FederationToken
- type FederationTokenProvider
- type FetchHeaderToMetaDataRule
- type FetchObjectInput
- type FetchObjectInputV2
- type FetchObjectOutput
- type FetchObjectOutputV2
- type Filter
- type FilterKey
- type FilterRule
- type GenericInput
- type GetBucketACLInput
- type GetBucketACLOutput
- type GetBucketCORSInput
- type GetBucketCORSOutput
- type GetBucketEncryptionInput
- type GetBucketEncryptionOutput
- type GetBucketLifecycleInput
- type GetBucketLifecycleOutput
- type GetBucketLocationInput
- type GetBucketLocationOutput
- type GetBucketMirrorBackInput
- type GetBucketMirrorBackOutput
- type GetBucketNotificationInput
- type GetBucketNotificationOutput
- type GetBucketNotificationType2Input
- type GetBucketNotificationType2Output
- type GetBucketPolicyOutput
- type GetBucketPolicyV2Input
- type GetBucketPolicyV2Output
- type GetBucketRealTimeLogInput
- type GetBucketRealTimeLogOutput
- type GetBucketRenameInput
- type GetBucketRenameOutput
- type GetBucketReplicationInput
- type GetBucketReplicationOutput
- type GetBucketTaggingInput
- type GetBucketTaggingOutput
- type GetBucketVersioningInput
- type GetBucketVersioningOutput
- type GetBucketVersioningOutputV2
- type GetBucketWebsiteInput
- type GetBucketWebsiteOutput
- type GetFetchTaskInput
- type GetFetchTaskOutput
- type GetFileStatusInput
- type GetFileStatusOutput
- type GetObjectACLInput
- type GetObjectACLOutput
- type GetObjectAclOutput
- type GetObjectBasicOutput
- type GetObjectOutput
- type GetObjectTaggingInput
- type GetObjectTaggingOutput
- type GetObjectToFileInput
- type GetObjectToFileOutput
- type GetObjectV2Input
- type GetObjectV2Output
- type GetSymlinkInput
- type GetSymlinkOutput
- type Grant
- type GrantV2
- type Grantee
- type GranteeV2
- type HeadBucketInput
- type HeadBucketOutput
- type HeadObjectOutput
- type HeadObjectV2Input
- type HeadObjectV2Output
- type IndexDocument
- type KV
- type KVs
- type LifecycleRule
- type LifecycleRuleFilter
- type ListBucketCustomDomainInput
- type ListBucketCustomDomainOutput
- type ListBucketsInput
- type ListBucketsOutput
- type ListMultipartUploadsInput
- type ListMultipartUploadsOutput
- type ListMultipartUploadsV2Input
- type ListMultipartUploadsV2Output
- type ListObjectVersionsInput
- type ListObjectVersionsOutput
- type ListObjectVersionsV2Input
- type ListObjectVersionsV2Output
- type ListObjectsInput
- type ListObjectsOutput
- type ListObjectsType2Input
- type ListObjectsType2Output
- type ListObjectsV2Input
- type ListObjectsV2Output
- type ListPartsInput
- type ListPartsOutput
- type ListUploadedPartsInput
- type ListUploadedPartsOutput
- type ListedBucket
- type ListedCommonPrefix
- type ListedDeleteMarker
- type ListedDeleteMarkerEntry
- type ListedObject
- type ListedObjectV2
- type ListedObjectVersion
- type ListedObjectVersionV2
- type ListedOwner
- type ListedUpload
- type Logger
- type Metadata
- type MirrorBackRule
- type MirrorHeader
- type MirrorHeaderKeyValue
- type MultipartUploadedPart
- type NoCurrentVersionExpiration
- type NoRetryClassifier
- type NonCurrentVersionTransition
- type NotificationDestination
- type NotificationFilter
- type NotificationFilterKey
- type NotificationFilterRule
- type NotificationRule
- type ObjectAclGrant
- type ObjectAclRules
- type ObjectMeta
- type ObjectMetaV2
- type ObjectTobeDeleted
- type Option
- func WithACL(acl string) Option
- func WithACLGrantFullControl(grantFullControl string) Option
- func WithACLGrantRead(grantRead string) Option
- func WithACLGrantReadAcp(grantReadAcp string) Option
- func WithACLGrantWrite(grantWrite string) Option
- func WithACLGrantWriteAcp(grantWriteAcp string) Option
- func WithCacheControl(cacheControl string) Option
- func WithContentDisposition(contentDisposition string) Option
- func WithContentEncoding(contentEncoding string) Option
- func WithContentLanguage(contentLanguage string) Option
- func WithContentLength(length int64) Option
- func WithContentMD5(contentMD5 string) Option
- func WithContentSHA256(contentSHA256 string) Option
- func WithContentType(contentType string) Option
- func WithCopySourceIfMatch(ifMatch string) Option
- func WithCopySourceIfModifiedSince(ifModifiedSince string) Option
- func WithCopySourceIfNoneMatch(ifNoneMatch string) Option
- func WithCopySourceIfUnmodifiedSince(ifUnmodifiedSince string) Option
- func WithExpires(expires time.Time) Option
- func WithHeader(key, value string) Option
- func WithIfMatch(ifMatch string) Option
- func WithIfModifiedSince(since time.Time) Option
- func WithIfNoneMatch(ifNoneMatch string) Option
- func WithIfUnmodifiedSince(since time.Time) Option
- func WithMeta(key, value string) Option
- func WithMetadataDirective(directive string) Option
- func WithPerRequestSigner(signer Signer) Option
- func WithQuery(key, value string) Option
- func WithRange(start, end int64) Option
- func WithServerSideEncryptionCustomer(ssecAlgorithm, ssecKey, ssecKeyMD5 string) Option
- func WithVersionID(versionID string) Option
- func WithWebsiteRedirectLocation(redirectLocation string) Option
- type Owner
- type PolicySignatureCondition
- type PostSignatureCondition
- type PreSignedPolicyURLGenerator
- type PreSignedURLInput
- type PreSignedURLOutput
- type PreSingedPolicyURLInput
- type PreSingedPolicyURLOutput
- type PreSingedPostSignatureInput
- type PreSingedPostSignatureOutput
- type PrivateSource
- type Progress
- type Proxy
- type PublicSource
- type PutBucketACLInput
- type PutBucketACLOutput
- type PutBucketCORSInput
- type PutBucketCORSOutput
- type PutBucketCustomDomainInput
- type PutBucketCustomDomainOutput
- type PutBucketEncryptionInput
- type PutBucketEncryptionOutput
- type PutBucketLifecycleInput
- type PutBucketMirrorBackInput
- type PutBucketMirrorBackOutput
- type PutBucketNotificationInput
- type PutBucketNotificationOutput
- type PutBucketNotificationType2Input
- type PutBucketNotificationType2Output
- type PutBucketPolicyOutput
- type PutBucketPolicyV2Input
- type PutBucketPolicyV2Output
- type PutBucketRealTimeLogInput
- type PutBucketRealTimeLogOutput
- type PutBucketRenameInput
- type PutBucketRenameOutput
- type PutBucketReplicationInput
- type PutBucketReplicationOutput
- type PutBucketStorageClassInput
- type PutBucketStorageClassOutput
- type PutBucketTaggingInput
- type PutBucketTaggingOutput
- type PutBucketVersioningInput
- type PutBucketVersioningOutput
- type PutBucketWebsiteInput
- type PutBucketWebsiteOutput
- type PutFetchTaskInput
- type PutFetchTaskInputV2
- type PutFetchTaskOutput
- type PutFetchTaskOutputV2
- type PutLifecycleOutput
- type PutObjectACLInput
- type PutObjectACLOutput
- type PutObjectAclInput
- type PutObjectAclOutput
- type PutObjectBasicInput
- type PutObjectFromFileInput
- type PutObjectFromFileOutput
- type PutObjectOutput
- type PutObjectTaggingInput
- type PutObjectTaggingOutput
- type PutObjectV2Input
- type PutObjectV2Output
- type PutSymlinkInput
- type PutSymlinkOutput
- type Range
- type RateLimiter
- type ReadCloserWithLimiter
- type RealTimeLogConfiguration
- type Redirect
- type RedirectAllRequestsTo
- type RenameObjectInput
- type RenameObjectOutput
- type ReplaceKeyPrefix
- type ReplicationRule
- type ReplicationRuleWithProgress
- type Request
- type RequestInfo
- type Response
- type RestoreInfo
- type RestoreJobParameters
- type RestoreObjectInput
- type RestoreObjectOutput
- type RestoreParam
- type RestoreStatus
- type ResumableCopyObjectInput
- type ResumableCopyObjectOutput
- type RocketMQConf
- type RocketMQConfiguration
- type RoutingRule
- type RoutingRuleCondition
- type RoutingRuleRedirect
- type RoutingRules
- type SSEHeaders
- type SerializeError
- type ServerErrorClassifier
- type SetObjectMetaInput
- type SetObjectMetaOutput
- type SignV4
- type SignV4Option
- type Signer
- type SigningKeyInfo
- type SourceEndpoint
- type StaticCredentials
- type StatusCodeClassifier
- type Tag
- type TagSet
- type TimeoutConn
- type TimeoutDialer
- type TosClientError
- type TosError
- type TosServerError
- type Transform
- type Transition
- type Transport
- type TransportConfig
- type UnexpectedStatusCodeError
- func (us *UnexpectedStatusCodeError) Error() string
- func (us *UnexpectedStatusCodeError) GoString() string
- func (us *UnexpectedStatusCodeError) WithEC(Ec string) *UnexpectedStatusCodeError
- func (us *UnexpectedStatusCodeError) WithRequestBody(res *Response) *UnexpectedStatusCodeError
- func (us *UnexpectedStatusCodeError) WithRequestID(requestID string) *UnexpectedStatusCodeError
- type UploadCommonPrefix
- type UploadEvent
- type UploadEventListener
- type UploadFileInput
- type UploadFileOutput
- type UploadInfo
- type UploadPartBasicInput
- type UploadPartCopyInput
- type UploadPartCopyOutput
- type UploadPartCopyV2Input
- type UploadPartCopyV2Output
- type UploadPartFromFileInput
- type UploadPartFromFileOutput
- type UploadPartInfo
- type UploadPartInput
- type UploadPartOutput
- type UploadPartV2Input
- type UploadPartV2Output
- type UploadedPart
- type UploadedPartV2
- type WithoutSecretKeyCredentials
Constants ¶
const ( MaxPartSize = 5 * 1024 * 1024 * 1024 MinPartSize = 5 * 1024 * 1024 DefaultPartSize = 20 * 1024 * 1024 )
const ( // Deprecated: use enum.ACLPrivate instead ACLPrivate = "private" // Deprecated: use enum.ACLPublicRead instead ACLPublicRead = "public-read" // Deprecated: use enum.ACLPublicReadWrite instead ACLPublicReadWrite = "public-read-write" // Deprecated: use enum.ACLAuthRead instead ACLAuthRead = "authenticated-read" // Deprecated: use enum.ACLBucketOwnerRead instead ACLBucketOwnerRead = "bucket-owner-read" // Deprecated: use enum.ACLBucketOwnerFullControl instead ACLBucketOwnerFullControl = "bucket-owner-full-control" // Deprecated: use enum.ACLLogDeliveryWrite instead ACLLogDeliveryWrite = "log-delivery-write" // Deprecated: use enum.PermissionRead instead PermissionRead = "READ" // Deprecated: use enum.PermissionWrite instead PermissionTypeWrite = "WRITE" // Deprecated: use enum.PermissionReadAcp instead PermissionTypeReadAcp = "READ_ACP" // Deprecated: use enum.PermissionWriteAcp instead PermissionTypeWriteAcp = "WRITE_ACP" // Deprecated: use enum.PermissionFullControl instead PermissionFullControl = "FULL_CONTROL" )
const ( // MetadataDirectiveReplace replace source object metadata when calling CopyObject MetadataDirectiveReplace = "REPLACE" // MetadataDirectiveCopy copy source object metadata when calling CopyObject MetadataDirectiveCopy = "COPY" )
const ( HeaderUserAgent = "User-Agent" HeaderContentLength = "Content-Length" HeaderContentType = "Content-Type" HeaderContentMD5 = "Content-MD5" HeaderContentSha256 = "X-Tos-Content-Sha256" HeaderContentLanguage = "Content-Language" HeaderContentEncoding = "Content-Encoding" HeaderContentDisposition = "Content-Disposition" HeaderLastModified = "Last-Modified" HeaderCacheControl = "Cache-Control" HeaderExpires = "Expires" HeaderETag = "ETag" HeaderVersionID = "X-Tos-Version-Id" HeaderDeleteMarker = "X-Tos-Delete-Marker" HeaderStorageClass = "X-Tos-Storage-Class" HeaderAzRedundancy = "X-Tos-Az-Redundancy" HeaderRestore = "X-Tos-Restore" HeaderRestoreRequestDate = "X-Tos-Restore-Request-Date" HeaderRestoreExpiryDays = "X-Tos-Restore-Expiry-Days" HeaderRestoreTier = "X-Tos-Restore-Tier" HeaderTag = "X-Tos-Tag" HeaderSSECustomerAlgorithm = "X-Tos-Server-Side-Encryption-Customer-Algorithm" HeaderSSECustomerKeyMD5 = "X-Tos-Server-Side-Encryption-Customer-Key-MD5" HeaderSSECustomerKey = "X-Tos-Server-Side-Encryption-Customer-Key" HeaderServerSideEncryption = "X-Tos-Server-Side-Encryption" HeaderServerSideEncryptionKmsKeyID = "X-Tos-Server-Side-Encryption-Kms-Key-Id" HeaderCopySourceSSECAlgorithm = "X-Tos-Server-Side-Encryption-Customer-Algorithm" HeaderCopySourceSSECKeyMD5 = "X-Tos-Server-Side-Encryption-Customer-Key-MD5" HeaderCopySourceSSECKey = "X-Tos-Server-Side-Encryption-Customer-Key" HeaderIfModifiedSince = "If-Modified-Since" HeaderIfUnmodifiedSince = "If-Unmodified-Since" HeaderIfMatch = "If-Match" HeaderIfNoneMatch = "If-None-Match" HeaderRange = "Range" HeaderContentRange = "Content-Range" HeaderRequestID = "X-Tos-Request-Id" HeaderID2 = "X-Tos-Id-2" HeaderBucketRegion = "X-Tos-Bucket-Region" HeaderLocation = "Location" HeaderACL = "X-Tos-Acl" HeaderGrantFullControl = "X-Tos-Grant-Full-Control" HeaderGrantRead = "X-Tos-Grant-Read" HeaderGrantReadAcp = "X-Tos-Grant-Read-Acp" HeaderGrantWrite = "X-Tos-Grant-Write" HeaderGrantWriteAcp = "X-Tos-Grant-Write-Acp" HeaderNextAppendOffset = "X-Tos-Next-Append-Offset" HeaderNextModifyOffset = "X-Tos-Next-Modify-Offset" HeaderObjectType = "X-Tos-Object-Type" HeaderHashCrc64ecma = "X-Tos-Hash-Crc64ecma" HeaderHashCrc32C = "X-Tos-Hash-Crc32c" HeaderMetadataDirective = "X-Tos-Metadata-Directive" HeaderCopySource = "X-Tos-Copy-Source" HeaderCopySourceIfMatch = "X-Tos-Copy-Source-If-Match" HeaderCopySourceIfNoneMatch = "X-Tos-Copy-Source-If-None-Match" HeaderCopySourceIfModifiedSince = "X-Tos-Copy-Source-If-Modified-Since" HeaderCopySourceIfUnmodifiedSince = "X-Tos-Copy-Source-If-Unmodified-Since" HeaderCopySourceRange = "X-Tos-Copy-Source-Range" HeaderCopySourceVersionID = "X-Tos-Copy-Source-Version-Id" HeaderWebsiteRedirectLocation = "X-Tos-Website-Redirect-Location" HeaderCSType = "X-Tos-Cs-Type" HeaderMetaPrefix = "X-Tos-Meta-" HeaderReplicationStatus = "X-Tos-Replication-Status" HeaderProjectName = "X-Tos-Project-Name" HeaderBucketType = "X-Tos-Bucket-Type" HeaderDirectory = "X-Tos-Directory" HeaderTOSEC = "X-Tos-Ec" HeaderExpect = "Expect" HeaderSymlinkTargetSize = "X-Tos-Symlink-Target-Size" HeaderSymlinkTarget = "X-Tos-Symlink-Target" HeaderSymlinkTargetBucket = "X-Tos-Symlink-Bucket" HeaderTosExpiration = "X-Tos-Expiration" HeaderTaggingCount = "X-Tos-Tagging-Count" )
const ( DefaultCacheCap = 100 VolceHostSuffix = "volces.com" HostSplitSep = "." HostSplitLength = 4 )
const ( FetchTaskStateFailed = "Failed" FetchTaskStateSucceed = "Succeed" FetchTaskStateExpired = "Expired" FetchTaskStateRunning = "Running" )
const ( NoRetry retryAction = iota Retry )
const ( DefaultRetryBackoffBase = 100 * time.Millisecond DefaultRetryTime = 3 )
const ( EventPartSucceed = 3 EventPartFailed = 4 EventPartAborted = 5 // The task needs to be interrupted in case of 403, 404, 405 errors )
const ( BucketVersioningEnable = "Enabled" BucketVersioningSuspended = "Suspended" )
const DefaultFilePerm = os.FileMode(0644)
const DefaultHighLatencyLogThreshold = 100 // KB
const DefaultListMaxKeys = 1000
const DefaultProgressCallbackSize = 512 * 1024
const DefaultTaskBufferSize = 100
const (
ISO8601TimeFormat = "2006-01-02T15:04:05.000Z07:00"
)
const (
QueryPartNumber = "partNumber"
)
const TempFileSuffix = ".temp"
const (
// Version tos-go-sdk version
Version = "v2.7.8"
)
Variables ¶
var ( InputIsNilClientError = newTosClientError("input is nil. ", nil) InputInvalidClientError = newTosClientError("input data is invalid. ", nil) InvalidPartNumber = newTosClientError("input part number is invalid. ", nil) InvalidUploadID = newTosClientError("input upload id is invalid. ", nil) InvalidBucketNameLength = newTosClientError("invalid bucket name, the length must be [3, 63]", nil) InvalidBucketNameCharacter = newTosClientError("invalid bucket name, the character set is illegal", nil) InvalidBucketNameStartingOrEnding = newTosClientError("invalid bucket name, the bucket name can be neither starting with '-' nor ending with '-'", nil) InvalidObjectNameLength = newTosClientError("invalid object name, the length must be [1, 696]", nil) InvalidObjectNameStartingOrEnding = newTosClientError("invalid object name, the object name can not start with '\\'", nil) InvalidObjectNameCharacterSet = newTosClientError("invalid object name, the character set is illegal", nil) InvalidACL = newTosClientError("invalid acl type", nil) InvalidStorageClass = newTosClientError("invalid storage class", nil) InvalidGrantee = newTosClientError("invalid grantee type", nil) InvalidCanned = newTosClientError("invalid canned type", nil) InvalidAzRedundancy = newTosClientError("invalid az redundancy type", nil) InvalidMetadataDirective = newTosClientError("invalid metadata directive type", nil) InvalidPermission = newTosClientError("invalid permission type", nil) InvalidSSECAlgorithm = newTosClientError("invalid encryption-decryption algorithm", nil) InvalidPartSize = newTosClientError("invalid part size, the size must be [5242880, 5368709120]", nil) InvalidSrcFilePath = newTosClientError("invalid file path, the file does not exist", nil) InvalidFilePartNum = newTosClientError("unsupported part number, the maximum is 10000", nil) InvalidMarshal = newTosClientError("unable to do serialization/deserialization", nil) InvalidPreSignedURLExpires = newTosClientError("invalid pre signed url expires, the time must be less 604800 seconds.", nil) InvalidPreSignedConditions = newTosClientError("invalid pre signed url conditions.", nil) InvalidFilePath = newTosClientError("invalid file path", nil) InvalidCheckpointFilePath = newTosClientError("invalid checkpoint file path", nil) CrcCheckFail = newTosClientError("crc check not equal", nil) InvalidS3Endpoint = newTosClientError("do not support s3 endpoint, please use tos endpoint", nil) NotSupportSeek = newTosClientError("reader not support seek", nil) ProxyNotSupportHttps = newTosClientError("proxy not support https", nil) ProxyUrlInvalid = newTosClientError("proxy url invalid", nil) NotificationConfigurationsInvalid = newTosClientError("Notification Configurations invalid", nil) InvalidCompleteAllPartsLength = newTosClientError("Should not specify both complete all and Parts", nil) InvalidPartsLength = newTosClientError("You must specify at least one part", nil) InvlidDeleteMultiObjectsLength = newTosClientError("You must specify at least one object", nil) )
var (
ErrETagMissMatch = errors.New("tos: ETag miss match")
)
var RefreshInterval = time.Second * 30
Functions ¶
func CRC64Combine ¶
CRC64Combine combines CRC64
func GetUnixTimeMs ¶ added in v2.2.0
func GetUnixTimeMs() int64
func IsValidBucketName ¶
func NewCRC ¶
NewCRC is similar with crc64.New, but you can set the initial value. Following methods are copied from package crc64 to implement Hash interface.
func OnRetryFromStart ¶ added in v2.5.0
func SigningKey ¶
func SigningKey(info *SigningKeyInfo) []byte
func StatueCode
deprecated
func StatusCode ¶
StatusCode return status code saved in TosServerError or UnexpectedStatusCodeError
func SupportedEndpoint ¶ added in v2.4.2
func SupportedRegion ¶
Types ¶
type AbortInCompleteMultipartUpload ¶ added in v2.4.0
type AbortInCompleteMultipartUpload struct {
DaysAfterInitiation int `json:"DaysAfterInitiation,omitempty"`
}
type AbortMultipartUploadOutput ¶
type AbortMultipartUploadOutput struct {
RequestInfo `json:"-"`
}
type AccessLogConfiguration ¶ added in v2.5.0
type AppendObjectOutput ¶
type AppendObjectOutput struct { RequestInfo `json:"-"` ETag string `json:"ETag,omitempty"` NextAppendOffset int64 `json:"NextAppendOffset,omitempty"` }
type AppendObjectV2Input ¶
type AppendObjectV2Input struct { Bucket string Key string Offset int64 `location:"query" locationName:"offset" default:"0"` Content io.Reader ContentLength int64 `location:"header" locationName:"Content-Length"` ContentMD5 string `location:"header" locationName:"Content-MD5"` ContentSHA256 string `location:"header" locationName:"X-Tos-Content-Sha256"` CacheControl string `location:"header" locationName:"Cache-Control"` ContentDisposition string `location:"header" locationName:"Content-Disposition" encodeChinese:"true"` ContentEncoding string `location:"header" locationName:"Content-Encoding"` ContentLanguage string `location:"header" locationName:"Content-Language"` ContentType string `location:"header" locationName:"Content-Type"` Expires time.Time `location:"header" locationName:"Expires"` ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional WebsiteRedirectLocation string `location:"header" locationName:"X-Tos-Website-Redirect-Location"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` TrafficLimit int64 `location:"header" locationName:"X-Tos-Traffic-Limit"` IfMatch string `location:"header" locationName:"X-Tos-If-Match"` ObjectExpires int64 `location:"header" locationName:"X-Tos-Object-Expires"` Meta map[string]string `location:"headers"` DataTransferListener DataTransferListener RateLimiter RateLimiter PreHashCrc64ecma uint64 }
type AppendObjectV2Output ¶
type AppendObjectV2Output struct { RequestInfo `json:"-"` VersionID string `json:"VersionID,omitempty"` NextAppendOffset int64 `json:"NextAppendOffset,omitempty"` HashCrc64ecma uint64 `json:"HashCrc64Ecma,omitempty"` }
type ApplyServerSideEncryptionByDefault ¶ added in v2.7.0
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
func (*Bucket) AbortMultipartUpload
deprecated
func (bkt *Bucket) AbortMultipartUpload(ctx context.Context, input *AbortMultipartUploadInput, options ...Option) (*AbortMultipartUploadOutput, error)
AbortMultipartUpload abort a multipart upload operation
Deprecated: use AbortMultipartUpload of ClientV2 instead
func (*Bucket) AppendObject
deprecated
func (bkt *Bucket) AppendObject(ctx context.Context, objectKey string, content io.Reader, offset int64, options ...Option) (*AppendObjectOutput, error)
AppendObject append content at the tail of an appendable object
objectKey: the name of object content: the content of object offset: append position, equals to the current object-size options: WithContentType set Content-Type, WithContentDisposition set Content-Disposition, WithContentLanguage set Content-Language, WithContentEncoding set Content-Encoding, WithCacheControl set Cache-Control, WithExpires set Expires, WithMeta set meta header(s), WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl above options only take effect when offset parameter is 0. WithContentSHA256 set Content-Sha256, WithContentMD5 set Content-MD5.
NOTICE: only content with a known length is supported now,
e.g, bytes.Buffer, bytes.Reader, strings.Reader, os.File, io.LimitedReader, net.Buffers. if the parameter content(an io.Reader) is not one of these, please use io.LimitReader(reader, length) to wrap this reader or use the WithContentLength option.
Deprecated: use AppendObject of ClientV2 instead
func (*Bucket) CompleteMultipartUpload
deprecated
func (bkt *Bucket) CompleteMultipartUpload(ctx context.Context, input *CompleteMultipartUploadInput, options ...Option) (*CompleteMultipartUploadOutput, error)
CompleteMultipartUpload complete a multipart upload operation
input: input.Key the object name, input.UploadID the uploadID got from CreateMultipartUpload input.UploadedParts upload part output got from UploadPart or UploadPartCopy
Deprecated: use CompleteMultipartUpload of ClientV2 instead
func (*Bucket) CopyObject
deprecated
func (bkt *Bucket) CopyObject(ctx context.Context, srcObjectKey, dstObjectKey string, options ...Option) (*CopyObjectOutput, error)
CopyObject copy an object
srcObjectKey: the source object name dstObjectKey: the destination object name. srcObjectKey and dstObjectKey belongs to the same bucket. options: WithVersionID the version id of source object, WithMetadataDirective copy source object metadata or replace with new object metadata, WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl, WithCopySourceIfMatch WithCopySourceIfNoneMatch WithCopySourceIfModifiedSince WithCopySourceIfUnmodifiedSince set copy conditions if CopyObject called with WithMetadataDirective(tos.MetadataDirectiveReplace), these options can be used: WithContentType set Content-Type, WithContentDisposition set Content-Disposition, WithContentLanguage set Content-Language, WithContentEncoding set Content-Encoding, WithCacheControl set Cache-Control, WithExpires set Expires, WithMeta set meta header(s),
Deprecated: use CopyObject of ClientV2 instead
func (*Bucket) CopyObjectFrom
deprecated
func (bkt *Bucket) CopyObjectFrom(ctx context.Context, srcBucket, srcObjectKey, dstObjectKey string, options ...Option) (*CopyObjectOutput, error)
CopyObjectFrom copy an object from target bucket
srcBucket: the srcBucket bucket srcObjectKey: the source object name dstObjectKey: the destination object name options: WithVersionID the version id of source object, WithMetadataDirective copy source object metadata or replace with new object metadata WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl, WithCopySourceIfMatch WithCopySourceIfNoneMatch WithCopySourceIfModifiedSince WithCopySourceIfUnmodifiedSince set copy conditions if CopyObjectFrom called with WithMetadataDirective(tos.MetadataDirectiveReplace), these options can be used: WithContentType set Content-Type, WithContentDisposition set Content-Disposition, WithContentLanguage set Content-Language, WithContentEncoding set Content-Encoding, WithCacheControl set Cache-Control, WithExpires set Expires, WithMeta set meta header(s),
Deprecated: use CopyObject of ClientV2 instead
func (*Bucket) CopyObjectTo
deprecated
func (bkt *Bucket) CopyObjectTo(ctx context.Context, dstBucket, dstObjectKey, srcObjectKey string, options ...Option) (*CopyObjectOutput, error)
CopyObjectTo copy an object to target bucket
dstBucket: the destination bucket dstObjectKey: the destination object name srcObjectKey: the source object name options: WithVersionID the version id of source object, WithMetadataDirective copy source object metadata or replace with new object metadata. WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl, WithCopySourceIfMatch WithCopySourceIfNoneMatch WithCopySourceIfModifiedSince WithCopySourceIfUnmodifiedSince set copy conditions if CopyObjectTo called with WithMetadataDirective(tos.MetadataDirectiveReplace), these options can be used: WithContentType set Content-Type, WithContentDisposition set Content-Disposition, WithContentLanguage set Content-Language, WithContentEncoding set Content-Encoding, WithCacheControl set Cache-Control, WithExpires set Expires, WithMeta set meta header(s),
Deprecated: use CopyObject of ClientV2 instead
func (*Bucket) CreateMultipartUpload
deprecated
func (bkt *Bucket) CreateMultipartUpload(ctx context.Context, objectKey string, options ...Option) (*CreateMultipartUploadOutput, error)
CreateMultipartUpload create a multipart upload operation
objectKey: the name of object options: WithContentType set Content-Type, WithContentDisposition set Content-Disposition, WithContentLanguage set Content-Language, WithContentEncoding set Content-Encoding, WithCacheControl set Cache-Control, WithExpires set Expires, WithMeta set meta header(s), WithContentSHA256 set Content-Sha256, WithContentMD5 set Content-MD5 WithExpires set Expires, WithServerSideEncryptionCustomer set server side encryption options WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl
Deprecated: use CreateMultipartUpload of ClientV2 instead
func (*Bucket) DeleteMultiObjects
deprecated
func (bkt *Bucket) DeleteMultiObjects(ctx context.Context, input *DeleteMultiObjectsInput, options ...Option) (*DeleteMultiObjectsOutput, error)
DeleteMultiObjects delete multi-objects
input: the objects will be deleted
Deprecated: use DeleteMultiObjects of ClientV2 instead
func (*Bucket) DeleteObject
deprecated
func (*Bucket) DeleteObjectTagging ¶ added in v2.6.2
func (bkt *Bucket) DeleteObjectTagging(ctx context.Context, input *DeleteObjectTaggingInput, option ...Option) (*DeleteObjectTaggingOutput, error)
func (*Bucket) FetchObject ¶
func (bkt *Bucket) FetchObject(ctx context.Context, input *FetchObjectInput, options ...Option) (*FetchObjectOutput, error)
FetchObject fetch an object from specified URL options:
WithMeta set meta header(s) WithServerSideEncryptionCustomer set server side encryption options WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl
Calling FetchObject will be blocked util fetch operation is finished
func (*Bucket) GetFetchTask ¶ added in v2.1.8
func (bkt *Bucket) GetFetchTask(ctx context.Context, input *GetFetchTaskInput, options ...Option) (*GetFetchTaskOutput, error)
GetFetchTask query the task state by the TaskID Task state:
FetchTaskStateFailed = "Failed" FetchTaskStateSucceed = "Succeed" FetchTaskStateExpired = "Expired" FetchTaskStateRunning = "Running"
func (*Bucket) GetObject
deprecated
func (bkt *Bucket) GetObject(ctx context.Context, objectKey string, options ...Option) (*GetObjectOutput, error)
GetObject get data and metadata of an object
objectKey: the name of object options: WithVersionID which version of this object WithRange the range of content, WithIfModifiedSince return if the object modified after the given date, otherwise return status code 304 WithIfUnmodifiedSince, WithIfMatch, WithIfNoneMatch set If-Unmodified-Since, If-Match and If-None-Match
Deprecated: use GetObject of ClientV2 instead
func (*Bucket) GetObjectAcl
deprecated
func (*Bucket) GetObjectTagging ¶ added in v2.6.2
func (bkt *Bucket) GetObjectTagging(ctx context.Context, input *GetObjectTaggingInput, option ...Option) (*GetObjectTaggingOutput, error)
func (*Bucket) GetSymlink ¶ added in v2.7.4
func (bkt *Bucket) GetSymlink(ctx context.Context, input *GetSymlinkInput, option ...Option) (*GetSymlinkOutput, error)
func (*Bucket) HeadObject
deprecated
func (bkt *Bucket) HeadObject(ctx context.Context, objectKey string, options ...Option) (*HeadObjectOutput, error)
HeadObject get metadata of an object
objectKey: the name of object options: WithVersionID which version of this object WithRange the range of content, WithIfModifiedSince return if the object modified after the given date, otherwise return status code 304 WithIfUnmodifiedSince, WithIfMatch, WithIfNoneMatch set If-Unmodified-Since, If-Match and If-None-Match
Deprecated: use HeadObject of ClientV2 instead
func (*Bucket) ListMultipartUploads
deprecated
func (bkt *Bucket) ListMultipartUploads(ctx context.Context, input *ListMultipartUploadsInput, options ...Option) (*ListMultipartUploadsOutput, error)
ListMultipartUploads list multipart uploads
Deprecated: use ListMultipartUploads of ClientV2 instead
func (*Bucket) ListObjectVersions
deprecated
func (bkt *Bucket) ListObjectVersions(ctx context.Context, input *ListObjectVersionsInput, options ...Option) (*ListObjectVersionsOutput, error)
ListObjectVersions list multi-version objects of a bucket
Deprecated: use ListObjectV2Versions of ClientV2 instead
func (*Bucket) ListObjects
deprecated
func (bkt *Bucket) ListObjects(ctx context.Context, input *ListObjectsInput, options ...Option) (*ListObjectsOutput, error)
ListObjects list objects of a bucket
Deprecated: use ListObjectsV2 of ClientV2 instead
func (*Bucket) ListUploadedParts
deprecated
func (bkt *Bucket) ListUploadedParts(ctx context.Context, input *ListUploadedPartsInput, options ...Option) (*ListUploadedPartsOutput, error)
ListUploadedParts List Uploaded Parts
objectKey: the object name input: key, uploadID and other parameters
Deprecated: use ListParts of ClientV2 instead
func (*Bucket) PutFetchTask ¶ added in v2.1.8
func (bkt *Bucket) PutFetchTask(ctx context.Context, input *PutFetchTaskInput, options ...Option) (*PutFetchTaskOutput, error)
PutFetchTask put a fetch task to a bucket options:
WithMeta set meta header(s) WithServerSideEncryptionCustomer set server side encryption options WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl
Calling PutFetchTask will return immediately after the task created.
func (*Bucket) PutObject
deprecated
func (bkt *Bucket) PutObject(ctx context.Context, objectKey string, content io.Reader, options ...Option) (*PutObjectOutput, error)
PutObject put an object
objectKey: the name of object content: the content of object options: WithContentType set Content-Type, WithContentDisposition set Content-Disposition, WithContentLanguage set Content-Language, WithContentEncoding set Content-Encoding, WithCacheControl set Cache-Control, WithExpires set Expires, WithMeta set meta header(s), WithContentSHA256 set Content-Sha256, WithContentMD5 set Content-MD5 WithExpires set Expires, WithServerSideEncryptionCustomer set server side encryption options WithACL WithACLGrantFullControl WithACLGrantRead WithACLGrantReadAcp WithACLGrantWrite WithACLGrantWriteAcp set object acl
NOTICE: only content with a known length is supported now,
e.g, bytes.Buffer, bytes.Reader, strings.Reader, os.File, io.LimitedReader, net.Buffers. if the parameter content(an io.Reader) is not one of these, please use io.LimitReader(reader, length) to wrap this reader or use the WithContentLength option.
Deprecated: use PutObjectV2 of ClientV2 instead
func (*Bucket) PutObjectAcl
deprecated
func (bkt *Bucket) PutObjectAcl(ctx context.Context, input *PutObjectAclInput, options ...Option) (*PutObjectAclOutput, error)
PutObjectAcl AclGrant, AclRules can not set both.
Deprecated: ues PutObjectACL of ClientV2 instead
func (*Bucket) PutObjectTagging ¶ added in v2.6.2
func (bkt *Bucket) PutObjectTagging(ctx context.Context, input *PutObjectTaggingInput, option ...Option) (*PutObjectTaggingOutput, error)
func (*Bucket) PutSymlink ¶ added in v2.7.4
func (bkt *Bucket) PutSymlink(ctx context.Context, input *PutSymlinkInput, option ...Option) (*PutSymlinkOutput, error)
func (*Bucket) RestoreObject ¶ added in v2.6.2
func (bkt *Bucket) RestoreObject(ctx context.Context, input *RestoreObjectInput, option ...Option) (*RestoreObjectOutput, error)
func (*Bucket) SetObjectMeta
deprecated
func (bkt *Bucket) SetObjectMeta(ctx context.Context, objectKey string, options ...Option) (*SetObjectMetaOutput, error)
SetObjectMeta overwrites metadata of the object
objectKey: the name of object options: WithContentType set Content-Type, WithContentDisposition set Content-Disposition, WithContentLanguage set Content-Language, WithContentEncoding set Content-Encoding, WithCacheControl set Cache-Control, WithExpires set Expires, WithMeta set meta header(s), WithVersionID which version of this object will be set
NOTICE: SetObjectMeta always overwrites all previous metadata
Deprecated: use SetObjectMeta of ClientV2 instead
func (*Bucket) UploadPart
deprecated
func (bkt *Bucket) UploadPart(ctx context.Context, input *UploadPartInput, options ...Option) (*UploadPartOutput, error)
UploadPart upload a part for a multipart upload operation input: the parameters, some fields is required, e.g. Key, UploadID, PartNumber and PartNumber
If uploading 'Content' with known Content-Length, please add option tos.WithContentLength
Deprecated: use UploadPart of ClientV2 instead
func (*Bucket) UploadPartCopy
deprecated
func (bkt *Bucket) UploadPartCopy(ctx context.Context, input *UploadPartCopyInput, options ...Option) (*UploadPartCopyOutput, error)
UploadPartCopy copy a part of object as a part of a multipart upload operation
input: uploadID, DestinationKey, SourceBucket, SourceKey and other parameters, options: WithCopySourceIfMatch WithCopySourceIfNoneMatch WithCopySourceIfModifiedSince WithCopySourceIfUnmodifiedSince set copy conditions
Deprecated: use UploadPartCopy of ClientV2 instead
type BucketEncryptionRule ¶ added in v2.7.0
type BucketEncryptionRule struct {
ApplyServerSideEncryptionByDefault ApplyServerSideEncryptionByDefault `json:"ApplyServerSideEncryptionByDefault"`
}
type BucketPolicy ¶
type BucketPolicy struct {
Policy string `json:"Policy,omitempty"`
}
type CancelHook ¶
type CancelHook interface { // Cancel 取消断点上传\断点下载事, isAbort 为 true 时删除上下文信息和临时文件,为 false 时只是中断当前执行,该接口只能调用一次 Cancel(isAbort bool) // contains filtered or unexported methods }
func NewCancelHook ¶ added in v2.2.0
func NewCancelHook() CancelHook
type ChecksumError ¶
type ChecksumError struct { RequestID string `json:"RequestId,omitempty"` ExpectedChecksum string `json:"ExpectedChecksum,omitempty"` ActualChecksum string `json:"ActualChecksum,omitempty"` }
func (*ChecksumError) Error ¶
func (ce *ChecksumError) Error() string
type Client
deprecated
type Client struct {
// contains filtered or unexported fields
}
Client TOS Client use NewClient to create a new Client
example:
client, err := NewClient(endpoint, WithCredentials(credentials), WithRegion(region)) if err != nil { // ... } // do something
if you only access the public bucket:
client, err := NewClient(endpoint) // do something
Deprecated: use ClientV2 instead
func NewClient ¶
func NewClient(endpoint string, options ...ClientOption) (*Client, error)
NewClient create a new Tos Client
endpoint: access endpoint options: WithCredentials set Credentials WithRegion set region, this is required if WithCredentials is used WithSocketTimeout set read-write timeout WithTransportConfig set TransportConfig WithTransport set self-defined Transport
func (*Client) CreateBucket
deprecated
func (cli *Client) CreateBucket(ctx context.Context, input *CreateBucketInput) (*CreateBucketOutput, error)
CreateBucket create a bucket
Deprecated: use CreateBucket of ClientV2 instead
func (*Client) DeleteBucket
deprecated
func (*Client) DeleteBucketPolicy ¶
func (cli *Client) DeleteBucketPolicy(ctx context.Context, bucket string) (*DeleteBucketPolicyOutput, error)
DeleteBucketPolicy delete bucket access policy
func (*Client) GetBucketACL ¶ added in v2.7.4
func (cli *Client) GetBucketACL(ctx context.Context, input *GetBucketACLInput, option ...Option) (*GetBucketACLOutput, error)
func (*Client) GetBucketPolicy ¶
func (cli *Client) GetBucketPolicy(ctx context.Context, bucket string) (*GetBucketPolicyOutput, error)
GetBucketPolicy get bucket access policy
func (*Client) GetBucketVersioning ¶
func (cli *Client) GetBucketVersioning(ctx context.Context, bucket string) (*GetBucketVersioningOutput, error)
GetBucketVersioning get the multi-version status of a bucket
func (*Client) HeadBucket
deprecated
func (*Client) ListBuckets
deprecated
func (cli *Client) ListBuckets(ctx context.Context, _ *ListBucketsInput) (*ListBucketsOutput, error)
ListBuckets list the buckets that the AK can access
Deprecated: use ListBuckets of ClientV2 instead
func (*Client) PreSignedURL ¶
func (cli *Client) PreSignedURL(httpMethod string, bucket, objectKey string, ttl time.Duration, options ...Option) (string, error)
PreSignedURL return pre-signed url
httpMethod: HTTP method, { PutObject: http.MethodPut GetObject: http.MethodGet HeadObject: http.MethodHead DeleteObject: http.MethodDelete }, bucket: the bucket name objectKey: the object name ttl: the time-to-live of signed URL options: WithVersionID the version id of the object Deprecated: use PreSignedURL of ClientV2 instead
func (*Client) PutBucketACL ¶ added in v2.7.4
func (cli *Client) PutBucketACL(ctx context.Context, input *PutBucketACLInput, option ...Option) (*PutBucketACLOutput, error)
func (*Client) PutBucketPolicy ¶
func (cli *Client) PutBucketPolicy(ctx context.Context, bucket string, policy *BucketPolicy) (*PutBucketPolicyOutput, error)
PutBucketPolicy set bucket access policy
type ClientOption ¶
type ClientOption func(*Client)
func WithAutoRecognizeContentType ¶
func WithAutoRecognizeContentType(enable bool) ClientOption
WithAutoRecognizeContentType set to recognize Content-Type or not, the default is enabled.
func WithConnectionTimeout ¶
func WithConnectionTimeout(timeout time.Duration) ClientOption
WithConnectionTimeout set timeout for constructing connection
func WithContentTypeRecognizer ¶
func WithContentTypeRecognizer(recognizer ContentTypeRecognizer) ClientOption
WithContentTypeRecognizer set ContentTypeRecognizer to recognize Content-Type, the default is ExtensionBasedContentTypeRecognizer
func WithCredentials ¶
func WithCredentials(credentials Credentials) ClientOption
WithCredentials set Credentials
see StaticCredentials, WithoutSecretKeyCredentials and FederationCredentials
func WithCustomDomain ¶ added in v2.6.0
func WithCustomDomain(isCustomDomain bool) ClientOption
func WithDNSCacheTime ¶ added in v2.3.0
func WithDNSCacheTime(dnsCacheTime int) ClientOption
WithDNSCacheTime set dnsCacheTime in Minute
func WithDisableEncodingMeta ¶ added in v2.6.3
func WithDisableEncodingMeta(disable bool) ClientOption
func WithEnableCRC ¶ added in v2.2.0
func WithEnableCRC(enableCRC bool) ClientOption
WithEnableCRC set if check crc after uploading object. Checking crc is enabled by default.
func WithEnableVerifySSL ¶
func WithEnableVerifySSL(enable bool) ClientOption
WithEnableVerifySSL set whether a client verifies the server's certificate chain and host name.
func WithExcept100ContinueThreshold ¶ added in v2.7.0
func WithExcept100ContinueThreshold(threshold int64) ClientOption
WithExcept100ContinueThreshold set threshold for 100 continue
func WithHTTPTransport ¶ added in v2.1.1
func WithHTTPTransport(transport http.RoundTripper) ClientOption
WithHTTPTransport set Transport of http.Client
func WithHighLatencyLogThreshold ¶ added in v2.6.5
func WithHighLatencyLogThreshold(highLatencyLogThreshold int) ClientOption
With the HighLatencyLogThreshold set and assuming the unit is in kilobytes (KB)
func WithIdleConnTimeout ¶
func WithIdleConnTimeout(timeout time.Duration) ClientOption
WithIdleConnTimeout set max idle time of a http connection
func WithLogger ¶ added in v2.2.0
func WithLogger(logger Logger) ClientOption
WithLogger sets the tos sdk logger
func WithMaxConnections ¶
func WithMaxConnections(max int) ClientOption
WithMaxConnections set maximum number of http connections
func WithMaxRetryCount ¶ added in v2.2.0
func WithMaxRetryCount(retryCount int) ClientOption
// WithMaxRetryCount set MaxRetryCount
func WithPathAccessMode
deprecated
func WithPathAccessMode(pathAccessMode bool) ClientOption
WithPathAccessMode url mode is path model or default mode
Deprecated: This option is deprecated. Setting PathAccessMode will be ignored silently.
func WithProxy ¶ added in v2.3.0
func WithProxy(proxy *Proxy) ClientOption
WithProxy set http Proxy for tos client
func WithRequestTimeout ¶
func WithRequestTimeout(timeout time.Duration) ClientOption
WithRequestTimeout set timeout for single http request
func WithSocketTimeout ¶
func WithSocketTimeout(readTimeout, writeTimeout time.Duration) ClientOption
WithSocketTimeout set read-write timeout
func WithTransport
deprecated
func WithTransport(transport Transport) ClientOption
WithTransport set Transport
Deprecated: this function is Deprecated. If you want to set http.Transport use WithHTTPTransport instead
func WithTransportConfig ¶
func WithTransportConfig(config *TransportConfig) ClientOption
WithTransportConfig set TransportConfig
func WithUserAgentSuffix ¶
func WithUserAgentSuffix(suffix string) ClientOption
WithUserAgentSuffix set suffix of user-agent
type ClientV2 ¶
type ClientV2 struct { Client // contains filtered or unexported fields }
ClientV2 TOS ClientV2 use NewClientV2 to create a new ClientV2
example:
client, err := NewClientV2(endpoint, WithCredentials(credentials), WithRegion(region)) if err != nil { // ... } // do something
if you only access the public bucket:
client, err := NewClientV2(endpoint) // do something
func NewClientV2 ¶
func NewClientV2(endpoint string, options ...ClientOption) (*ClientV2, error)
NewClientV2 create a new Tos ClientV2
endpoint: access endpoint options: WithCredentials set Credentials WithRegion set region, this is required if WithCredentials is used. If Region is supported and the Endpoint parameter is not set, the Endpoint will be resolved automatically WithSocketTimeout set read-write timeout WithTransportConfig set TransportConfig WithTransport set self-defined Transport WithLogger set self-defined Logger WithEnableCRC set CRC switch. WithMaxRetryCount set Max Retry Count
func (*ClientV2) AbortMultipartUpload ¶
func (cli *ClientV2) AbortMultipartUpload(ctx context.Context, input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error)
AbortMultipartUpload abort a multipart upload operation
func (*ClientV2) AppendObjectV2 ¶
func (cli *ClientV2) AppendObjectV2(ctx context.Context, input *AppendObjectV2Input) (*AppendObjectV2Output, error)
AppendObjectV2 append content at the tail of an appendable object HNS bucket append requires the object to already exist
func (*ClientV2) CompleteMultipartUploadV2 ¶
func (cli *ClientV2) CompleteMultipartUploadV2( ctx context.Context, input *CompleteMultipartUploadV2Input) (*CompleteMultipartUploadV2Output, error)
CompleteMultipartUploadV2 complete a multipart upload operation
func (*ClientV2) CopyObject ¶
func (cli *ClientV2) CopyObject(ctx context.Context, input *CopyObjectInput) (*CopyObjectOutput, error)
CopyObject copy an object
func (*ClientV2) CreateBucketV2 ¶
func (cli *ClientV2) CreateBucketV2(ctx context.Context, input *CreateBucketV2Input) (*CreateBucketV2Output, error)
CreateBucketV2 create a bucket
func (*ClientV2) CreateMultipartUploadV2 ¶
func (cli *ClientV2) CreateMultipartUploadV2( ctx context.Context, input *CreateMultipartUploadV2Input) (*CreateMultipartUploadV2Output, error)
CreateMultipartUploadV2 create a multipart upload operation
func (*ClientV2) DeleteBucket ¶
func (cli *ClientV2) DeleteBucket(ctx context.Context, input *DeleteBucketInput) (*DeleteBucketOutput, error)
DeleteBucket delete a bucket.Deleting a non-empty bucket is not allowed. A bucket is empty only if there is no exist object and uncanceled segmented tasks.
func (*ClientV2) DeleteBucketCORS ¶ added in v2.1.10
func (cli *ClientV2) DeleteBucketCORS(ctx context.Context, input *DeleteBucketCORSInput) (*DeleteBucketCORSOutput, error)
DeleteBucketCORS delete the bucket's all CORS settings.
func (*ClientV2) DeleteBucketCustomDomain ¶ added in v2.5.0
func (cli *ClientV2) DeleteBucketCustomDomain(ctx context.Context, input *DeleteBucketCustomDomainInput) (*DeleteBucketCustomDomainOutput, error)
func (*ClientV2) DeleteBucketEncryption ¶ added in v2.7.0
func (cli *ClientV2) DeleteBucketEncryption(ctx context.Context, input *DeleteBucketEncryptionInput) (*DeleteBucketEncryptionOutput, error)
func (*ClientV2) DeleteBucketLifecycle ¶ added in v2.4.0
func (cli *ClientV2) DeleteBucketLifecycle(ctx context.Context, input *DeleteBucketLifecycleInput) (*DeleteBucketLifecycleOutput, error)
func (*ClientV2) DeleteBucketMirrorBack ¶ added in v2.4.0
func (cli *ClientV2) DeleteBucketMirrorBack(ctx context.Context, input *DeleteBucketMirrorBackInput) (*DeleteBucketMirrorBackOutput, error)
func (*ClientV2) DeleteBucketPolicyV2 ¶ added in v2.4.0
func (cli *ClientV2) DeleteBucketPolicyV2(ctx context.Context, input *DeleteBucketPolicyV2Input) (*DeleteBucketPolicyV2Output, error)
func (*ClientV2) DeleteBucketRealTimeLog ¶ added in v2.5.0
func (cli *ClientV2) DeleteBucketRealTimeLog(ctx context.Context, input *DeleteBucketRealTimeLogInput) (*DeleteBucketRealTimeLogOutput, error)
func (*ClientV2) DeleteBucketRename ¶ added in v2.5.4
func (cli *ClientV2) DeleteBucketRename(ctx context.Context, input *DeleteBucketRenameInput) (*DeleteBucketRenameOutput, error)
func (*ClientV2) DeleteBucketReplication ¶ added in v2.5.0
func (cli *ClientV2) DeleteBucketReplication(ctx context.Context, input *DeleteBucketReplicationInput) (*DeleteBucketReplicationOutput, error)
func (*ClientV2) DeleteBucketTagging ¶ added in v2.6.6
func (cli *ClientV2) DeleteBucketTagging(ctx context.Context, input *DeleteBucketTaggingInput) (*DeleteBucketTaggingOutput, error)
func (*ClientV2) DeleteBucketWebsite ¶ added in v2.5.0
func (cli *ClientV2) DeleteBucketWebsite(ctx context.Context, input *DeleteBucketWebsiteInput) (*DeleteBucketWebsiteOutput, error)
func (*ClientV2) DeleteMultiObjects ¶
func (cli *ClientV2) DeleteMultiObjects(ctx context.Context, input *DeleteMultiObjectsInput) (*DeleteMultiObjectsOutput, error)
DeleteMultiObjects delete multi-objects
func (*ClientV2) DeleteObjectTagging ¶ added in v2.4.0
func (cli *ClientV2) DeleteObjectTagging(ctx context.Context, input *DeleteObjectTaggingInput) (*DeleteObjectTaggingOutput, error)
func (*ClientV2) DeleteObjectV2 ¶
func (cli *ClientV2) DeleteObjectV2(ctx context.Context, input *DeleteObjectV2Input) (*DeleteObjectV2Output, error)
DeleteObjectV2 delete an object
func (*ClientV2) DownloadFile ¶ added in v2.2.0
func (cli *ClientV2) DownloadFile(ctx context.Context, input *DownloadFileInput) (*DownloadFileOutput, error)
func (*ClientV2) FetchObjectV2 ¶ added in v2.4.0
func (cli *ClientV2) FetchObjectV2(ctx context.Context, input *FetchObjectInputV2) (*FetchObjectOutputV2, error)
func (*ClientV2) GetBucketACL ¶ added in v2.4.0
func (cli *ClientV2) GetBucketACL(ctx context.Context, input *GetBucketACLInput) (*GetBucketACLOutput, error)
func (*ClientV2) GetBucketCORS ¶ added in v2.1.10
func (cli *ClientV2) GetBucketCORS(ctx context.Context, input *GetBucketCORSInput) (*GetBucketCORSOutput, error)
GetBucketCORS get the bucket's CORS settings.
func (*ClientV2) GetBucketEncryption ¶ added in v2.7.0
func (cli *ClientV2) GetBucketEncryption(ctx context.Context, input *GetBucketEncryptionInput) (*GetBucketEncryptionOutput, error)
func (*ClientV2) GetBucketLifecycle ¶ added in v2.4.0
func (cli *ClientV2) GetBucketLifecycle(ctx context.Context, input *GetBucketLifecycleInput) (*GetBucketLifecycleOutput, error)
func (*ClientV2) GetBucketLocation ¶ added in v2.4.0
func (cli *ClientV2) GetBucketLocation(ctx context.Context, input *GetBucketLocationInput) (*GetBucketLocationOutput, error)
func (*ClientV2) GetBucketMirrorBack ¶ added in v2.4.0
func (cli *ClientV2) GetBucketMirrorBack(ctx context.Context, input *GetBucketMirrorBackInput) (*GetBucketMirrorBackOutput, error)
func (*ClientV2) GetBucketNotification ¶ added in v2.5.0
func (cli *ClientV2) GetBucketNotification(ctx context.Context, input *GetBucketNotificationInput) (*GetBucketNotificationOutput, error)
func (*ClientV2) GetBucketNotificationType2 ¶ added in v2.6.6
func (cli *ClientV2) GetBucketNotificationType2(ctx context.Context, input *GetBucketNotificationType2Input) (*GetBucketNotificationType2Output, error)
func (*ClientV2) GetBucketPolicyV2 ¶ added in v2.4.0
func (cli *ClientV2) GetBucketPolicyV2(ctx context.Context, input *GetBucketPolicyV2Input) (*GetBucketPolicyV2Output, error)
func (*ClientV2) GetBucketRealTimeLog ¶ added in v2.5.0
func (cli *ClientV2) GetBucketRealTimeLog(ctx context.Context, input *GetBucketRealTimeLogInput) (*GetBucketRealTimeLogOutput, error)
func (*ClientV2) GetBucketRename ¶ added in v2.5.4
func (cli *ClientV2) GetBucketRename(ctx context.Context, input *GetBucketRenameInput) (*GetBucketRenameOutput, error)
func (*ClientV2) GetBucketReplication ¶ added in v2.5.0
func (cli *ClientV2) GetBucketReplication(ctx context.Context, input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error)
func (*ClientV2) GetBucketTagging ¶ added in v2.6.6
func (cli *ClientV2) GetBucketTagging(ctx context.Context, input *GetBucketTaggingInput) (*GetBucketTaggingOutput, error)
func (*ClientV2) GetBucketVersioning ¶ added in v2.5.0
func (cli *ClientV2) GetBucketVersioning(ctx context.Context, input *GetBucketVersioningInput) (*GetBucketVersioningOutputV2, error)
func (*ClientV2) GetBucketWebsite ¶ added in v2.5.0
func (cli *ClientV2) GetBucketWebsite(ctx context.Context, input *GetBucketWebsiteInput) (*GetBucketWebsiteOutput, error)
func (*ClientV2) GetFileStatus ¶ added in v2.6.8
func (cli *ClientV2) GetFileStatus(ctx context.Context, input *GetFileStatusInput) (*GetFileStatusOutput, error)
func (*ClientV2) GetObjectACL ¶
func (cli *ClientV2) GetObjectACL(ctx context.Context, input *GetObjectACLInput) (*GetObjectACLOutput, error)
GetObjectACL get object ACL
func (*ClientV2) GetObjectTagging ¶ added in v2.4.0
func (cli *ClientV2) GetObjectTagging(ctx context.Context, input *GetObjectTaggingInput) (*GetObjectTaggingOutput, error)
func (*ClientV2) GetObjectToFile ¶
func (cli *ClientV2) GetObjectToFile(ctx context.Context, input *GetObjectToFileInput) (*GetObjectToFileOutput, error)
GetObjectToFile get object and write it to file
func (*ClientV2) GetObjectV2 ¶
func (cli *ClientV2) GetObjectV2(ctx context.Context, input *GetObjectV2Input) (*GetObjectV2Output, error)
GetObjectV2 get data and metadata of an object
func (*ClientV2) GetSymlink ¶ added in v2.7.4
func (cli *ClientV2) GetSymlink(ctx context.Context, input *GetSymlinkInput) (*GetSymlinkOutput, error)
func (*ClientV2) HeadBucket ¶
func (cli *ClientV2) HeadBucket(ctx context.Context, input *HeadBucketInput) (*HeadBucketOutput, error)
HeadBucket get some info of a bucket
func (*ClientV2) HeadObjectV2 ¶
func (cli *ClientV2) HeadObjectV2(ctx context.Context, input *HeadObjectV2Input) (*HeadObjectV2Output, error)
HeadObjectV2 get metadata of an object
func (*ClientV2) ListBucketCustomDomain ¶ added in v2.5.0
func (cli *ClientV2) ListBucketCustomDomain(ctx context.Context, input *ListBucketCustomDomainInput) (*ListBucketCustomDomainOutput, error)
func (*ClientV2) ListBuckets ¶ added in v2.1.5
func (cli *ClientV2) ListBuckets(ctx context.Context, input *ListBucketsInput) (*ListBucketsOutput, error)
ListBuckets list the buckets that the AK can access
func (*ClientV2) ListMultipartUploadsV2 ¶
func (cli *ClientV2) ListMultipartUploadsV2( ctx context.Context, input *ListMultipartUploadsV2Input) (*ListMultipartUploadsV2Output, error)
ListMultipartUploadsV2 list multipart uploads
func (*ClientV2) ListObjectVersionsV2 ¶
func (cli *ClientV2) ListObjectVersionsV2( ctx context.Context, input *ListObjectVersionsV2Input) (*ListObjectVersionsV2Output, error)
ListObjectVersionsV2 list multi-version objects of a bucket
func (*ClientV2) ListObjectsType2 ¶ added in v2.4.0
func (cli *ClientV2) ListObjectsType2(ctx context.Context, input *ListObjectsType2Input) (*ListObjectsType2Output, error)
func (*ClientV2) ListObjectsV2 ¶
func (cli *ClientV2) ListObjectsV2(ctx context.Context, input *ListObjectsV2Input) (*ListObjectsV2Output, error)
ListObjectsV2 list objects of a bucket Deprecated: use ListObjectsType2 of ClientV2 instead
func (*ClientV2) ListParts ¶
func (cli *ClientV2) ListParts(ctx context.Context, input *ListPartsInput) (*ListPartsOutput, error)
ListParts List Uploaded Parts
func (*ClientV2) PreSignedPolicyURL ¶ added in v2.4.5
func (cli *ClientV2) PreSignedPolicyURL(ctx context.Context, input *PreSingedPolicyURLInput) (*PreSingedPolicyURLOutput, error)
func (*ClientV2) PreSignedPostSignature ¶ added in v2.4.0
func (cli *ClientV2) PreSignedPostSignature(ctx context.Context, input *PreSingedPostSignatureInput) (*PreSingedPostSignatureOutput, error)
func (*ClientV2) PreSignedURL ¶
func (cli *ClientV2) PreSignedURL(input *PreSignedURLInput) (*PreSignedURLOutput, error)
PreSignedURL return pre-signed url
func (*ClientV2) PutBucketACL ¶ added in v2.4.0
func (cli *ClientV2) PutBucketACL(ctx context.Context, input *PutBucketACLInput) (*PutBucketACLOutput, error)
func (*ClientV2) PutBucketCORS ¶ added in v2.1.10
func (cli *ClientV2) PutBucketCORS(ctx context.Context, input *PutBucketCORSInput) (*PutBucketCORSOutput, error)
PutBucketCORS upsert the bucket's CORS settings.
func (*ClientV2) PutBucketCustomDomain ¶ added in v2.5.0
func (cli *ClientV2) PutBucketCustomDomain(ctx context.Context, input *PutBucketCustomDomainInput) (*PutBucketCustomDomainOutput, error)
func (*ClientV2) PutBucketEncryption ¶ added in v2.7.0
func (cli *ClientV2) PutBucketEncryption(ctx context.Context, input *PutBucketEncryptionInput) (*PutBucketEncryptionOutput, error)
func (*ClientV2) PutBucketLifecycle ¶ added in v2.4.0
func (cli *ClientV2) PutBucketLifecycle(ctx context.Context, input *PutBucketLifecycleInput) (*PutLifecycleOutput, error)
func (*ClientV2) PutBucketMirrorBack ¶ added in v2.4.0
func (cli *ClientV2) PutBucketMirrorBack(ctx context.Context, input *PutBucketMirrorBackInput) (*PutBucketMirrorBackOutput, error)
func (*ClientV2) PutBucketNotification ¶ added in v2.5.0
func (cli *ClientV2) PutBucketNotification(ctx context.Context, input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error)
func (*ClientV2) PutBucketNotificationType2 ¶ added in v2.6.6
func (cli *ClientV2) PutBucketNotificationType2(ctx context.Context, input *PutBucketNotificationType2Input) (*PutBucketNotificationType2Output, error)
func (*ClientV2) PutBucketPolicyV2 ¶ added in v2.4.0
func (cli *ClientV2) PutBucketPolicyV2(ctx context.Context, input *PutBucketPolicyV2Input) (*PutBucketPolicyV2Output, error)
func (*ClientV2) PutBucketRealTimeLog ¶ added in v2.5.0
func (cli *ClientV2) PutBucketRealTimeLog(ctx context.Context, input *PutBucketRealTimeLogInput) (*PutBucketRealTimeLogOutput, error)
func (*ClientV2) PutBucketRename ¶ added in v2.5.4
func (cli *ClientV2) PutBucketRename(ctx context.Context, input *PutBucketRenameInput) (*PutBucketRenameOutput, error)
func (*ClientV2) PutBucketReplication ¶ added in v2.5.0
func (cli *ClientV2) PutBucketReplication(ctx context.Context, input *PutBucketReplicationInput) (*PutBucketReplicationOutput, error)
func (*ClientV2) PutBucketStorageClass ¶ added in v2.4.0
func (cli *ClientV2) PutBucketStorageClass(ctx context.Context, input *PutBucketStorageClassInput) (*PutBucketStorageClassOutput, error)
func (*ClientV2) PutBucketTagging ¶ added in v2.6.6
func (cli *ClientV2) PutBucketTagging(ctx context.Context, input *PutBucketTaggingInput) (*PutBucketTaggingOutput, error)
func (*ClientV2) PutBucketVersioning ¶ added in v2.5.0
func (cli *ClientV2) PutBucketVersioning(ctx context.Context, input *PutBucketVersioningInput) (*PutBucketVersioningOutput, error)
func (*ClientV2) PutBucketWebsite ¶ added in v2.5.0
func (cli *ClientV2) PutBucketWebsite(ctx context.Context, input *PutBucketWebsiteInput) (*PutBucketWebsiteOutput, error)
func (*ClientV2) PutFetchTaskV2 ¶ added in v2.4.0
func (cli *ClientV2) PutFetchTaskV2(ctx context.Context, input *PutFetchTaskInputV2) (*PutFetchTaskOutputV2, error)
func (*ClientV2) PutObjectACL ¶
func (cli *ClientV2) PutObjectACL(ctx context.Context, input *PutObjectACLInput) (*PutObjectACLOutput, error)
PutObjectACL put object ACL
func (*ClientV2) PutObjectFromFile ¶
func (cli *ClientV2) PutObjectFromFile(ctx context.Context, input *PutObjectFromFileInput) (*PutObjectFromFileOutput, error)
PutObjectFromFile put an object from file
func (*ClientV2) PutObjectTagging ¶ added in v2.4.0
func (cli *ClientV2) PutObjectTagging(ctx context.Context, input *PutObjectTaggingInput) (*PutObjectTaggingOutput, error)
func (*ClientV2) PutObjectV2 ¶
func (cli *ClientV2) PutObjectV2(ctx context.Context, input *PutObjectV2Input) (*PutObjectV2Output, error)
PutObjectV2 put an object
func (*ClientV2) PutSymlink ¶ added in v2.7.4
func (cli *ClientV2) PutSymlink(ctx context.Context, input *PutSymlinkInput) (*PutSymlinkOutput, error)
func (*ClientV2) RenameObject ¶ added in v2.5.4
func (cli *ClientV2) RenameObject(ctx context.Context, input *RenameObjectInput) (*RenameObjectOutput, error)
func (*ClientV2) RestoreObject ¶ added in v2.6.0
func (cli *ClientV2) RestoreObject(ctx context.Context, input *RestoreObjectInput) (*RestoreObjectOutput, error)
func (*ClientV2) ResumableCopyObject ¶ added in v2.5.0
func (cli *ClientV2) ResumableCopyObject(ctx context.Context, input *ResumableCopyObjectInput) (*ResumableCopyObjectOutput, error)
func (*ClientV2) SetHTTPTransport ¶ added in v2.1.2
func (cli *ClientV2) SetHTTPTransport(transport http.RoundTripper)
func (*ClientV2) SetObjectMeta ¶
func (cli *ClientV2) SetObjectMeta(ctx context.Context, input *SetObjectMetaInput) (*SetObjectMetaOutput, error)
SetObjectMeta overwrites metadata of the object
func (*ClientV2) UploadFile ¶
func (cli *ClientV2) UploadFile(ctx context.Context, input *UploadFileInput) (output *UploadFileOutput, err error)
func (*ClientV2) UploadPartCopyV2 ¶
func (cli *ClientV2) UploadPartCopyV2( ctx context.Context, input *UploadPartCopyV2Input) (*UploadPartCopyV2Output, error)
UploadPartCopyV2 copy a part of object as a part of a multipart upload operation
func (*ClientV2) UploadPartFromFile ¶
func (cli *ClientV2) UploadPartFromFile(ctx context.Context, input *UploadPartFromFileInput) (*UploadPartFromFileOutput, error)
UploadPartFromFile upload a part for a multipart upload operation from file
func (*ClientV2) UploadPartV2 ¶
func (cli *ClientV2) UploadPartV2(ctx context.Context, input *UploadPartV2Input) (*UploadPartV2Output, error)
UploadPartV2 upload a part for a multipart upload operation
type CloudFunctionConfiguration ¶ added in v2.5.0
type CommonHeaders ¶
type CommonHeaders struct { ContentLength int64 `location:"header" locationName:"Content-Length"` ContentMD5 string `location:"header" locationName:"Content-MD5"` ContentSHA256 string `location:"header" locationName:"X-Tos-Content-Sha256"` CacheControl string `location:"header" locationName:"Cache-Control"` ContentDisposition string `location:"header" locationName:"Content-Disposition" encodeChinese:"true"` ContentEncoding string `location:"header" locationName:"Content-Encoding"` ContentLanguage string `location:"header" locationName:"Content-Language"` ContentType string `location:"header" locationName:"Content-Type"` Expires time.Time `location:"header" locationName:"Expires"` ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional WebsiteRedirectLocation string `location:"header" locationName:"X-Tos-Website-Redirect-Location"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` }
type CommonSourceEndpoint ¶ added in v2.7.2
type CommonSourceEndpoint struct { Primary []EndpointCredentialProvider `json:"Primary,omitempty"` Follower []EndpointCredentialProvider `json:"Follower,omitempty"` }
type CompleteMultipartUploadInput ¶
type CompleteMultipartUploadInput struct { Key string `json:"Key,omitempty"` UploadID string `json:"UploadId,omitempty"` UploadedParts []MultipartUploadedPart `json:"UploadedParts,omitempty"` }
type CompleteMultipartUploadV2Input ¶
type CompleteMultipartUploadV2Input struct { Bucket string Key string CompleteAll bool UploadID string `location:"query" locationName:"uploadId"` Callback string `location:"header" locationName:"X-Tos-Callback"` CallbackVar string `location:"header" locationName:"X-Tos-Callback-Var"` ForbidOverwrite bool `location:"header" locationName:"X-Tos-Forbid-Overwrite"` Parts []UploadedPartV2 }
type Config ¶
type Config struct { Endpoint string Region string TransportConfig TransportConfig }
type ContentLengthRange ¶ added in v2.4.0
type ContentTypeRecognizer ¶
type CopyEventListener ¶ added in v2.5.0
type CopyEventListener interface {
EventChange(event *CopyEvent)
}
type CopyObjectInput ¶
type CopyObjectInput struct { Bucket string Key string SrcBucket string SrcKey string SrcVersionID string `location:"query" locationName:"versionId"` CacheControl string `location:"header" locationName:"Cache-Control"` ContentDisposition string `location:"header" locationName:"Content-Disposition" encodeChinese:"true"` ContentEncoding string `location:"header" locationName:"Content-Encoding"` ContentLanguage string `location:"header" locationName:"Content-Language"` ContentType string `location:"header" locationName:"Content-Type"` Expires time.Time `location:"header" locationName:"Expires"` ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional WebsiteRedirectLocation string `location:"header" locationName:"X-Tos-Website-Redirect-Location"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` CopySourceIfMatch string `location:"header" locationName:"X-Tos-Copy-Source-If-Match"` CopySourceIfModifiedSince time.Time `location:"header" locationName:"X-Tos-Copy-Source-If-Modified-Since"` CopySourceIfNoneMatch string `location:"header" locationName:"X-Tos-Copy-Source-If-None-Match"` CopySourceIfUnmodifiedSince time.Time `location:"header" locationName:"X-Tos-Copy-Source-If-Unmodified-Since"` CopySourceSSECAlgorithm string `location:"header" locationName:"X-Tos-Copy-Source-Server-Side-Encryption-Customer-Algorithm"` CopySourceSSECKey string `location:"header" locationName:"X-Tos-Copy-Source-Server-Side-Encryption-Customer-Key"` CopySourceSSECKeyMD5 string `location:"header" locationName:"X-Tos-Copy-Source-Server-Side-Encryption-Customer-Key-MD5"` ServerSideEncryption string `location:"header" locationName:"X-Tos-Server-Side-Encryption"` ServerSideEncryptionKeyID string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Kms-Key-Id"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` TrafficLimit int64 `location:"header" locationName:"X-Tos-Traffic-Limit"` ForbidOverwrite bool `location:"header" locationName:"X-Tos-Forbid-Overwrite"` IfMatch string `location:"header" locationName:"X-Tos-If-Match"` MetadataDirective enum.MetadataDirectiveType `location:"header" locationName:"X-Tos-Metadata-Directive"` Tagging string `location:"header" locationName:"X-Tos-Tagging"` ObjectExpires int64 `location:"header" locationName:"X-Tos-Object-Expires"` TaggingDirective enum.TaggingDirectiveType `location:"header" locationName:"X-Tos-Tagging-Directive"` Meta map[string]string `location:"headers"` }
type CopyObjectOutput ¶
type CopyObjectOutput struct { RequestInfo `json:"-"` VersionID string `json:"VersionId,omitempty"` SourceVersionID string `json:"SourceVersionId,omitempty"` ETag string `json:"ETag,omitempty"` // at body LastModified string `json:"LastModified,omitempty"` // at body SSECAlgorithm string `json:"SSECAlgorithm,omitempty"` SSECKeyMD5 string `json:"SSECKeyMD5,omitempty"` ServerSideEncryption string `json:"ServerSideEncryption,omitempty"` ServerSideEncryptionKeyID string `json:"ServerSideEncryptionKmsKeyId,omitempty"` }
type CopyPartInfo ¶ added in v2.5.0
type CopySource ¶
type CopySource struct {
// contains filtered or unexported fields
}
type CorsRule ¶ added in v2.1.10
type CorsRule struct { AllowedOrigin []string `json:"AllowedOrigins,omitempty"` AllowedMethod []string `json:"AllowedMethods,omitempty"` AllowedHeader []string `json:"AllowedHeaders,omitempty"` ExposeHeader []string `json:"ExposeHeaders,omitempty"` MaxAgeSeconds int `json:"MaxAgeSeconds,omitempty"` ResponseVary bool `json:"ResponseVary,omitempty"` }
type CreateBucketInput ¶
type CreateBucketInput struct { Bucket string `json:"Bucket,omitempty"` // required ACL string `json:"ACL,omitempty"` // optional GrantFullControl string `json:"GrantFullControl,omitempty"` // optional GrantRead string `json:"GrantRead,omitempty"` // optional GrantReadAcp string `json:"GrantReadAcp,omitempty"` // optional GrantWrite string `json:"GrantWrite,omitempty"` // optional GrantWriteAcp string `json:"GrantWriteAcp,omitempty"` // optional }
type CreateBucketOutput ¶
type CreateBucketOutput struct { RequestInfo `json:"-"` Location string `json:"Location,omitempty"` }
type CreateBucketV2Input ¶
type CreateBucketV2Input struct { Bucket string // required ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` // optional GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional GrantWrite string `location:"header" locationName:"X-Tos-Grant-Write"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` // setting the default storage type for buckets AzRedundancy enum.AzRedundancyType `location:"header" locationName:"X-Tos-Az-Redundancy"` // setting the AZ type for buckets ProjectName string `location:"header" locationName:"X-Tos-Project-Name"` BucketType enum.BucketType `location:"header" locationName:"X-Tos-Bucket-Type"` }
type CreateBucketV2Output ¶
type CreateBucketV2Output struct {
CreateBucketOutput
}
type CreateMultipartUploadOutput ¶
type CreateMultipartUploadOutput struct { RequestInfo `json:"-"` Bucket string `json:"Bucket,omitempty"` Key string `json:"Key,omitempty"` UploadID string `json:"UploadId,omitempty"` SSECustomerAlgorithm string `json:"SSECustomerAlgorithm,omitempty"` SSECustomerKeyMD5 string `json:"SSECustomerKeyMD5,omitempty"` }
type CreateMultipartUploadV2Input ¶
type CreateMultipartUploadV2Input struct { Bucket string Key string EncodingType string `location:"query" locationName:"encoding-type"` // "" or "url" CacheControl string `location:"header" locationName:"Cache-Control"` ContentDisposition string `location:"header" locationName:"Content-Disposition" encodeChinese:"true"` ContentEncoding string `location:"header" locationName:"Content-Encoding"` ContentLanguage string `location:"header" locationName:"Content-Language"` ContentType string `location:"header" locationName:"Content-Type"` Expires time.Time `location:"header" locationName:"Expires"` ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional WebsiteRedirectLocation string `location:"header" locationName:"X-Tos-Website-Redirect-Location"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` ServerSideEncryption string `location:"header" locationName:"X-Tos-Server-Side-Encryption"` ServerSideEncryptionKeyID string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Kms-Key-Id"` ForbidOverwrite bool `location:"header" locationName:"X-Tos-Forbid-Overwrite"` Tagging string `location:"header" locationName:"X-Tos-Tagging"` ObjectExpires int64 `location:"header" locationName:"X-Tos-Object-Expires"` Meta map[string]string `location:"headers"` }
type CreateMultipartUploadV2Output ¶
type CreateMultipartUploadV2Output struct { RequestInfo `json:"-"` Bucket string `json:"Bucket,omitempty"` Key string `json:"Key,omitempty"` UploadID string `json:"UploadID,omitempty"` SSECAlgorithm string `json:"SSECAlgorithm,omitempty"` SSECKeyMD5 string `json:"SSECKeyMD5,omitempty"` EncodingType string `json:"EncodingType,omitempty"` ServerSideEncryption string `json:"ServerSideEncryption,omitempty"` ServerSideEncryptionKeyID string `json:"ServerSideEncryptionKeyID,omitempty"` }
type Credential ¶
type CredentialProvider ¶ added in v2.7.2
type CredentialProvider struct {
Role string `json:"Role,omitempty"`
}
type Credentials ¶
type Credentials interface {
Credential() Credential
}
Credentials provides Credential
type CustomDomainRule ¶ added in v2.5.0
type CustomMeta ¶ added in v2.1.3
type CustomMeta struct {
// contains filtered or unexported fields
}
func (*CustomMeta) AllKeys ¶ added in v2.1.3
func (c *CustomMeta) AllKeys() []string
func (*CustomMeta) Range ¶ added in v2.1.3
func (c *CustomMeta) Range(f func(key, val string) bool)
type DataTransferListener ¶
type DataTransferListener interface {
DataTransferStatusChange(status *DataTransferStatus)
}
type DataTransferStatus ¶
type DefaultTransport ¶
type DefaultTransport struct {
// contains filtered or unexported fields
}
func NewDefaultTransport ¶
func NewDefaultTransport(config *TransportConfig) *DefaultTransport
NewDefaultTransport create a DefaultTransport with config
func NewDefaultTransportWithClient ¶
func NewDefaultTransportWithClient(client http.Client) *DefaultTransport
NewDefaultTransportWithClient crate a DefaultTransport with a http.Client
func (*DefaultTransport) WithDefaultTransportLogger ¶ added in v2.2.0
func (d *DefaultTransport) WithDefaultTransportLogger(logger Logger)
type DeleteBucketCORSInput ¶ added in v2.1.10
type DeleteBucketCORSInput struct {
Bucket string
}
type DeleteBucketCORSOutput ¶ added in v2.1.10
type DeleteBucketCORSOutput struct {
RequestInfo `json:"-"`
}
type DeleteBucketCustomDomainInput ¶ added in v2.5.0
type DeleteBucketCustomDomainOutput ¶ added in v2.5.0
type DeleteBucketCustomDomainOutput struct {
RequestInfo
}
type DeleteBucketEncryptionInput ¶ added in v2.7.0
type DeleteBucketEncryptionInput struct {
Bucket string
}
type DeleteBucketEncryptionOutput ¶ added in v2.7.0
type DeleteBucketEncryptionOutput struct {
RequestInfo `json:"-"`
}
type DeleteBucketInput ¶
type DeleteBucketInput struct {
Bucket string
}
type DeleteBucketLifecycleInput ¶ added in v2.4.0
type DeleteBucketLifecycleInput struct {
Bucket string
}
type DeleteBucketLifecycleOutput ¶ added in v2.4.0
type DeleteBucketLifecycleOutput struct {
RequestInfo
}
type DeleteBucketMirrorBackInput ¶ added in v2.4.0
type DeleteBucketMirrorBackInput struct {
Bucket string
}
type DeleteBucketMirrorBackOutput ¶ added in v2.4.0
type DeleteBucketMirrorBackOutput struct {
RequestInfo
}
type DeleteBucketOutput ¶
type DeleteBucketOutput struct {
RequestInfo `json:"-"`
}
type DeleteBucketPolicyOutput ¶
type DeleteBucketPolicyOutput struct {
RequestInfo `json:"-"`
}
type DeleteBucketPolicyV2Input ¶ added in v2.4.0
type DeleteBucketPolicyV2Input struct {
Bucket string `json:"-"`
}
type DeleteBucketPolicyV2Output ¶ added in v2.4.0
type DeleteBucketPolicyV2Output struct {
RequestInfo
}
type DeleteBucketRealTimeLogInput ¶ added in v2.5.0
type DeleteBucketRealTimeLogInput struct {
Bucket string
}
type DeleteBucketRealTimeLogOutput ¶ added in v2.5.0
type DeleteBucketRealTimeLogOutput struct {
RequestInfo
}
type DeleteBucketRenameInput ¶ added in v2.5.4
type DeleteBucketRenameInput struct {
Bucket string
}
type DeleteBucketRenameOutput ¶ added in v2.5.4
type DeleteBucketRenameOutput struct {
RequestInfo
}
type DeleteBucketReplicationInput ¶ added in v2.5.0
type DeleteBucketReplicationInput struct {
Bucket string
}
type DeleteBucketReplicationOutput ¶ added in v2.5.0
type DeleteBucketReplicationOutput struct {
RequestInfo
}
type DeleteBucketTaggingInput ¶ added in v2.6.6
type DeleteBucketTaggingInput struct {
Bucket string // required
}
type DeleteBucketTaggingOutput ¶ added in v2.6.6
type DeleteBucketTaggingOutput struct {
RequestInfo
}
type DeleteBucketWebsiteInput ¶ added in v2.5.0
type DeleteBucketWebsiteInput struct {
Bucket string
}
type DeleteBucketWebsiteOutput ¶ added in v2.5.0
type DeleteBucketWebsiteOutput struct {
RequestInfo
}
type DeleteError ¶
type DeleteMultiObjectsInput ¶
type DeleteMultiObjectsInput struct { Bucket string Objects []ObjectTobeDeleted `json:"Objects,omitempty"` Quiet bool `json:"Quiet,omitempty"` }
type DeleteMultiObjectsOutput ¶
type DeleteMultiObjectsOutput struct { RequestInfo `json:"-"` Deleted []DeletedV2 `json:"Deleted,omitempty"` // 删除成功的Object列表 Error []DeleteError `json:"Error,omitempty"` // 删除失败的Object列表 }
type DeleteObjectOutput ¶
type DeleteObjectOutput struct { RequestInfo `json:"-"` DeleteMarker bool `json:"DeleteMarker,omitempty"` VersionID string `json:"VersionId,omitempty"` }
type DeleteObjectTaggingInput ¶ added in v2.4.0
type DeleteObjectTaggingOutput ¶ added in v2.4.0
type DeleteObjectTaggingOutput struct { RequestInfo VersionID string }
type DeleteObjectV2Input ¶
type DeleteObjectV2Output ¶
type DeleteObjectV2Output struct {
DeleteObjectOutput
}
type Destination ¶ added in v2.5.0
type Destination struct { Bucket string `json:"Bucket"` Location string `json:"Location"` StorageClass enum.StorageClassType `json:"StorageClass,omitempty"` StorageClassInheritDirective enum.StorageClassInheritDirectiveType `json:"StorageClassInheritDirective,omitempty"` }
type DestinationRocketMQ ¶ added in v2.6.6
type DestinationVeFaaS ¶ added in v2.6.6
type DestinationVeFaaS struct {
FunctionID string `json:"FunctionId"`
}
type DownloadEvent ¶
type DownloadEvent struct { Type enum.DownloadEventType Err error // not empty when it occurs when failed, aborted event occurs Bucket string Key string VersionID string FilePath string // path of the file to download to CheckpointFile *string // path to checkpoint file TempFilePath *string // path fo the temp file // not empty when download part event occurs DowloadPartInfo *DownloadPartInfo }
type DownloadEventListener ¶
type DownloadEventListener interface {
EventChange(event *DownloadEvent)
}
type DownloadFileInput ¶
type DownloadFileInput struct { HeadObjectV2Input FilePath string PartSize int64 TaskNum int EnableCheckpoint bool CheckpointFile string TrafficLimit int64 DownloadEventListener DownloadEventListener DataTransferListener DataTransferListener RateLimiter RateLimiter CancelHook CancelHook // user can not set this filed // contains filtered or unexported fields }
type DownloadFileOutput ¶
type DownloadFileOutput struct {
HeadObjectV2Output
}
type DownloadPartInfo ¶
DownloadPartInfo is returned when DownloadEvent occur
type ETagCheckReadCloser ¶
type ETagCheckReadCloser struct {
// contains filtered or unexported fields
}
ETagCheckReadCloser checks ETag on read EOF
func NewETagCheckReadCloser ¶
func NewETagCheckReadCloser(reader io.ReadCloser, eTag, requestID string) *ETagCheckReadCloser
func (*ETagCheckReadCloser) Close ¶
func (ec *ETagCheckReadCloser) Close() error
type EmptyContentTypeRecognizer ¶
type EmptyContentTypeRecognizer struct{}
func (EmptyContentTypeRecognizer) ContentType ¶
func (er EmptyContentTypeRecognizer) ContentType(objectKey string) string
type EndpointCredentialProvider ¶ added in v2.7.2
type EndpointCredentialProvider struct { Endpoint string `json:"Endpoint,omitempty"` BucketName string `json:"BucketName,omitempty"` CredentialProvider *CredentialProvider `json:"CredentialProvider,omitempty"` }
type Error ¶
type ErrorDocument ¶ added in v2.5.0
type ErrorDocument struct {
Key string `json:"Key"`
}
type Expiration ¶ added in v2.4.0
type ExtensionBasedContentTypeRecognizer ¶
type ExtensionBasedContentTypeRecognizer struct{}
func (ExtensionBasedContentTypeRecognizer) ContentType ¶
func (er ExtensionBasedContentTypeRecognizer) ContentType(objectKey string) string
type FederationCredentials ¶
type FederationCredentials struct {
// contains filtered or unexported fields
}
FederationCredentials implements Credentials interfaces with flushing Credential periodically
func NewFederationCredentials ¶
func NewFederationCredentials(tokenProvider FederationTokenProvider) (*FederationCredentials, error)
NewFederationCredentials FederationCredentials implements Credentials interfaces with flushing Credential periodically
use WithPreFetch set prefetch time
func (*FederationCredentials) Credential ¶
func (fc *FederationCredentials) Credential() Credential
Credential for Credentials interface
func (*FederationCredentials) WithPreFetch ¶
func (fc *FederationCredentials) WithPreFetch(preFetch time.Duration)
WithPreFetch set prefetch time
type FederationToken ¶
type FederationToken struct { Credential Credential Expiration time.Time }
FederationToken contains Credential and Credential's expiration time
type FederationTokenProvider ¶
type FederationTokenProvider interface {
FederationToken() (*FederationToken, error)
}
FederationTokenProvider provides FederationToken
type FetchHeaderToMetaDataRule ¶ added in v2.7.0
type FetchObjectInput ¶
type FetchObjectInputV2 ¶ added in v2.4.0
type FetchObjectInputV2 struct { Bucket string Key string ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` GrantReadACP string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` GrantWriteACP string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` Meta map[string]string `location:"headers"` URL string `json:"URL,omitempty"` IgnoreSameKey bool `json:"IgnoreSameKey,omitempty"` ContentMD5 string `json:"ContentMD5,omitempty"` // Deprecated: use content md5 instead HexMD5 string }
type FetchObjectOutput ¶
type FetchObjectOutput struct { RequestInfo `json:"-"` VersionID string `json:"VersionId,omitempty"` // may be empty ETag string `json:"ETag,omitempty"` }
type FetchObjectOutputV2 ¶ added in v2.4.0
type FetchObjectOutputV2 struct { RequestInfo VersionID string `json:"VersionId,omitempty"` Etag string `json:"Etag,omitempty"` SSECAlgorithm string `json:"SSECAlgorithm,omitempty"` SSECKeyMD5 string `json:"SSECKeyMD5,omitempty"` }
type FilterKey ¶ added in v2.5.0
type FilterKey struct {
Rules []FilterRule `json:"FilterRules"`
}
type FilterRule ¶ added in v2.5.0
type GenericInput ¶ added in v2.6.8
type GetBucketACLInput ¶ added in v2.4.0
type GetBucketACLInput struct {
Bucket string
}
type GetBucketACLOutput ¶ added in v2.4.0
type GetBucketACLOutput struct { RequestInfo Owner Owner `json:"Owner,omitempty"` Grants []GrantV2 `json:"Grants,omitempty"` BucketAclDelivered bool `json:"BucketAclDelivered"` }
type GetBucketCORSInput ¶ added in v2.1.10
type GetBucketCORSInput struct {
Bucket string
}
type GetBucketCORSOutput ¶ added in v2.1.10
type GetBucketCORSOutput struct { RequestInfo `json:"-"` CORSRules []CorsRule `json:"CORSRules,omitempty"` }
type GetBucketEncryptionInput ¶ added in v2.7.0
type GetBucketEncryptionInput struct {
Bucket string
}
type GetBucketEncryptionOutput ¶ added in v2.7.0
type GetBucketEncryptionOutput struct { RequestInfo Rule BucketEncryptionRule }
type GetBucketLifecycleInput ¶ added in v2.4.0
type GetBucketLifecycleInput struct {
Bucket string
}
type GetBucketLifecycleOutput ¶ added in v2.4.0
type GetBucketLifecycleOutput struct { RequestInfo Rules []LifecycleRule `json:"Rules"` }
type GetBucketLocationInput ¶ added in v2.4.0
type GetBucketLocationInput struct {
Bucket string
}
type GetBucketLocationOutput ¶ added in v2.4.0
type GetBucketLocationOutput struct { RequestInfo `json:"-"` Region string `json:"Region,omitempty"` ExtranetEndpoint string `json:"ExtranetEndpoint,omitempty"` IntranetEndpoint string `json:"IntranetEndpoint,omitempty"` }
type GetBucketMirrorBackInput ¶ added in v2.4.0
type GetBucketMirrorBackInput struct {
Bucket string
}
type GetBucketMirrorBackOutput ¶ added in v2.4.0
type GetBucketMirrorBackOutput struct { RequestInfo Rules []MirrorBackRule }
type GetBucketNotificationInput ¶ added in v2.5.0
type GetBucketNotificationInput struct {
Bucket string
}
type GetBucketNotificationOutput ¶ added in v2.5.0
type GetBucketNotificationOutput struct { RequestInfo CloudFunctionConfigurations []CloudFunctionConfiguration `json:"CloudFunctionConfigurations"` RocketMQConfigurations []RocketMQConfiguration `json:"RocketMQConfigurations"` }
type GetBucketNotificationType2Input ¶ added in v2.6.6
type GetBucketNotificationType2Input struct {
Bucket string
}
type GetBucketNotificationType2Output ¶ added in v2.6.6
type GetBucketNotificationType2Output struct { RequestInfo Rules []NotificationRule `json:"Rules"` Version string `json:"Version"` }
type GetBucketPolicyOutput ¶
type GetBucketPolicyOutput struct { RequestInfo `json:"-"` Policy string `json:"Policy,omitempty"` }
type GetBucketPolicyV2Input ¶ added in v2.4.0
type GetBucketPolicyV2Input struct {
Bucket string `json:"-"`
}
type GetBucketPolicyV2Output ¶ added in v2.4.0
type GetBucketPolicyV2Output struct { RequestInfo `json:"-"` Policy string `json:"Policy,omitempty"` }
type GetBucketRealTimeLogInput ¶ added in v2.5.0
type GetBucketRealTimeLogInput struct {
Bucket string
}
type GetBucketRealTimeLogOutput ¶ added in v2.5.0
type GetBucketRealTimeLogOutput struct { RequestInfo Configuration RealTimeLogConfiguration `json:"RealTimeLogConfiguration"` }
type GetBucketRenameInput ¶ added in v2.5.4
type GetBucketRenameInput struct {
Bucket string
}
type GetBucketRenameOutput ¶ added in v2.5.4
type GetBucketRenameOutput struct { RequestInfo RenameEnable bool }
type GetBucketReplicationInput ¶ added in v2.5.0
type GetBucketReplicationOutput ¶ added in v2.5.0
type GetBucketReplicationOutput struct { RequestInfo Role string `json:"Role"` Rules []ReplicationRuleWithProgress `json:"Rules"` }
type GetBucketTaggingInput ¶ added in v2.6.6
type GetBucketTaggingInput struct {
Bucket string // required
}
type GetBucketTaggingOutput ¶ added in v2.6.6
type GetBucketTaggingOutput struct { RequestInfo TagSet TagSet }
type GetBucketVersioningInput ¶ added in v2.5.0
type GetBucketVersioningInput struct {
Bucket string
}
type GetBucketVersioningOutput ¶
type GetBucketVersioningOutput struct { RequestInfo `json:"-"` Status string `json:"Status"` }
type GetBucketVersioningOutputV2 ¶ added in v2.5.0
type GetBucketVersioningOutputV2 struct { RequestInfo Status enum.VersioningStatusType `json:"Status"` }
type GetBucketWebsiteInput ¶ added in v2.5.0
type GetBucketWebsiteInput struct {
Bucket string
}
type GetBucketWebsiteOutput ¶ added in v2.5.0
type GetBucketWebsiteOutput struct { RequestInfo RedirectAllRequestsTo *RedirectAllRequestsTo `json:"RedirectAllRequestsTo,omitempty"` IndexDocument *IndexDocument `json:"IndexDocument,omitempty"` ErrorDocument *ErrorDocument `json:"ErrorDocument,omitempty"` RoutingRules []RoutingRule `json:"RoutingRules,omitempty"` }
type GetFetchTaskInput ¶ added in v2.1.8
type GetFetchTaskInput struct {
TaskID string `json:"taskID,omitempty"`
}
type GetFetchTaskOutput ¶ added in v2.1.8
type GetFetchTaskOutput struct { RequestInfo `json:"-"` State string `json:"State,omitempty"` }
type GetFileStatusInput ¶ added in v2.6.8
type GetFileStatusInput struct { GenericInput // v2.8.0 Bucket string // required Key string // required }
type GetFileStatusOutput ¶ added in v2.6.8
type GetObjectACLInput ¶
type GetObjectACLOutput ¶
type GetObjectAclOutput ¶
type GetObjectBasicOutput ¶
type GetObjectBasicOutput struct { RequestInfo ContentRange string // don't move into ObjectMetaV2 ObjectMetaV2 }
type GetObjectOutput ¶
type GetObjectOutput struct { RequestInfo `json:"-"` ContentRange string `json:"ContentRange,omitempty"` Content io.ReadCloser `json:"-"` ObjectMeta }
type GetObjectTaggingInput ¶ added in v2.4.0
type GetObjectTaggingOutput ¶ added in v2.4.0
type GetObjectTaggingOutput struct { RequestInfo VersionID string TagSet TagSet }
type GetObjectToFileInput ¶
type GetObjectToFileInput struct { GetObjectV2Input FilePath string }
type GetObjectToFileOutput ¶
type GetObjectToFileOutput struct {
GetObjectBasicOutput
}
type GetObjectV2Input ¶
type GetObjectV2Input struct { Bucket string Key string VersionID string `location:"query" locationName:"versionId"` IfMatch string `location:"header" locationName:"If-Match"` IfModifiedSince time.Time `location:"header" locationName:"If-Modified-Since"` IfNoneMatch string `location:"header" locationName:"If-None-Match"` IfUnmodifiedSince time.Time `location:"header" locationName:"If-Unmodified-Since"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` TrafficLimit int64 `location:"header" locationName:"X-Tos-Traffic-Limit"` ResponseCacheControl string `location:"query" locationName:"response-cache-control"` ResponseContentDisposition string `location:"query" locationName:"response-content-disposition"` ResponseContentEncoding string `location:"query" locationName:"response-content-encoding"` ResponseContentLanguage string `location:"query" locationName:"response-content-language"` ResponseContentType string `location:"query" locationName:"response-content-type"` ResponseExpires time.Time `location:"query" locationName:"response-expires"` Process string `location:"query" locationName:"x-tos-process"` SaveBucket string `location:"query" locationName:"x-tos-save-bucket"` SaveObject string `location:"query" locationName:"x-tos-save-object"` DocPage int `location:"query" locationName:"x-tos-doc-page"` SrcType enum.DocPreviewSrcType `location:"query" locationName:"x-tos-doc-src-type"` DstType enum.DocPreviewDstType `location:"query" locationName:"x-tos-doc-dst-type"` RangeStart int64 RangeEnd int64 Range string DataTransferListener DataTransferListener RateLimiter RateLimiter // Deprecated Not Use PartNumber int }
type GetObjectV2Output ¶
type GetObjectV2Output struct { GetObjectBasicOutput Content io.ReadCloser }
func ParseGetObjectV2Output ¶ added in v2.4.7
func ParseGetObjectV2Output(httpRes *http.Response, expectedCode int) (*GetObjectV2Output, error)
ParseGetObjectV2Output Parse the incoming parameters of *http.Response type, and respond to the return value of *GetObjectV2Output type.
type GetSymlinkInput ¶ added in v2.7.4
type GetSymlinkOutput ¶ added in v2.7.4
type Grant ¶
type Grant struct { Grantee Grantee `json:"Grantee,omitempty"` Permission enum.PermissionType `json:"Permission,omitempty"` }
type GrantV2 ¶ added in v2.1.3
type GrantV2 struct { GranteeV2 GranteeV2 `json:"Grantee,omitempty"` Permission enum.PermissionType `json:"Permission,omitempty"` }
type GranteeV2 ¶ added in v2.1.3
type GranteeV2 struct { ID string `json:"ID,omitempty"` DisplayName string `json:"DisplayName,omitempty"` Type enum.GranteeType `json:"Type,omitempty"` Canned enum.CannedType `json:"Canned,omitempty"` }
type HeadBucketInput ¶
type HeadBucketInput struct {
Bucket string
}
type HeadBucketOutput ¶
type HeadBucketOutput struct { RequestInfo `json:"-"` Region string `json:"Region,omitempty"` StorageClass enum.StorageClassType `json:"StorageClass,omitempty"` AzRedundancy enum.AzRedundancyType `json:"AzRedundancy"` ProjectName string `json:"ProjectName"` BucketType enum.BucketType `json:"BucketType"` }
type HeadObjectOutput ¶
type HeadObjectOutput struct { RequestInfo `json:"-"` ContentRange string `json:"ContentRange,omitempty"` ObjectMeta SymlinkTargetSize int64 `location:"header" locationName:"X-Tos-Symlink-Target-Size"` }
type HeadObjectV2Input ¶
type HeadObjectV2Input struct { Bucket string Key string VersionID string `location:"query" locationName:"versionId"` IfMatch string `location:"header" locationName:"If-Match"` IfModifiedSince time.Time `location:"header" locationName:"If-Modified-Since"` IfNoneMatch string `location:"header" locationName:"If-None-Match"` IfUnmodifiedSince time.Time `location:"header" locationName:"If-Unmodified-Since"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` }
type HeadObjectV2Output ¶
type HeadObjectV2Output struct { RequestInfo `json:"-"` ObjectMetaV2 SymlinkTargetSize int64 `location:"header" locationName:"X-Tos-Symlink-Target-Size"` }
func ParseHeadObjectV2Output ¶ added in v2.4.7
func ParseHeadObjectV2Output(httpRes *http.Response) (*HeadObjectV2Output, error)
ParseHeadObjectV2Output Parse the incoming parameters of *http.Response type, and respond to the return value of *HeadObjectV2Output type.
type IndexDocument ¶ added in v2.5.0
type LifecycleRule ¶ added in v2.4.0
type LifecycleRule struct { ID string `json:"ID,omitempty"` Prefix string `json:"Prefix,omitempty"` Status enum.StatusType `json:"Status,omitempty"` Transitions []Transition `json:"Transitions,omitempty"` Expiration *Expiration `json:"Expiration,omitempty"` NonCurrentVersionTransition []NonCurrentVersionTransition `json:"NoncurrentVersionTransitions,omitempty"` NoCurrentVersionExpiration *NoCurrentVersionExpiration `json:"NoncurrentVersionExpiration,omitempty"` Tag []Tag `json:"Tags,omitempty"` AbortInCompleteMultipartUpload *AbortInCompleteMultipartUpload `json:"AbortIncompleteMultipartUpload,omitempty"` Filter *LifecycleRuleFilter `json:"Filter,omitempty"` }
type LifecycleRuleFilter ¶ added in v2.7.0
type LifecycleRuleFilter struct { ObjectSizeGreaterThan int `json:"ObjectSizeGreaterThan"` GreaterThanIncludeEqual enum.StatusType `json:"GreaterThanIncludeEqual"` ObjectSizeLessThan int `json:"ObjectSizeLessThan"` LessThanIncludeEqual enum.StatusType `json:"LessThanIncludeEqual"` }
type ListBucketCustomDomainInput ¶ added in v2.5.0
type ListBucketCustomDomainInput struct {
Bucket string
}
type ListBucketCustomDomainOutput ¶ added in v2.5.0
type ListBucketCustomDomainOutput struct { RequestInfo Rules []CustomDomainRule `json:"CustomDomainRules"` }
type ListBucketsInput ¶
type ListBucketsInput struct { ProjectName string `location:"header" locationName:"X-Tos-Project-Name"` BucketType enum.BucketType `location:"header" locationName:"X-Tos-Bucket-Type"` }
type ListBucketsOutput ¶
type ListBucketsOutput struct { RequestInfo `json:"-"` Buckets []ListedBucket `json:"Buckets,omitempty"` Owner ListedOwner `json:"Owner,omitempty"` }
type ListMultipartUploadsOutput ¶
type ListMultipartUploadsOutput struct { RequestInfo `json:"-"` Bucket string `json:"Bucket,omitempty"` KeyMarker string `json:"KeyMarker,omitempty"` UploadIdMarker string `json:"UploadIdMarker,omitempty"` NextKeyMarker string `json:"NextKeyMarker,omitempty"` NextUploadIdMarker string `json:"NextUploadIdMarker,omitempty"` Delimiter string `json:"Delimiter,omitempty"` Prefix string `json:"Prefix,omitempty"` MaxUploads int32 `json:"MaxUploads,omitempty"` IsTruncated bool `json:"IsTruncated,omitempty"` Upload []UploadInfo `json:"Uploads,omitempty"` CommonPrefixes []UploadCommonPrefix `json:"CommonPrefixes,omitempty"` }
type ListMultipartUploadsV2Input ¶
type ListMultipartUploadsV2Input struct { Bucket string Prefix string `location:"query" locationName:"prefix"` Delimiter string `location:"query" locationName:"delimiter"` KeyMarker string `location:"query" locationName:"key-marker"` UploadIDMarker string `location:"query" locationName:"upload-id-marker"` MaxUploads int `location:"query" locationName:"max-uploads"` EncodingType string `location:"query" locationName:"encoding-type"` // "" or "url" }
type ListMultipartUploadsV2Output ¶
type ListMultipartUploadsV2Output struct { RequestInfo Bucket string Prefix string KeyMarker string UploadIDMarker string MaxUploads int Delimiter string IsTruncated bool EncodingType string NextKeyMarker string NextUploadIDMarker string CommonPrefixes []ListedCommonPrefix Uploads []ListedUpload }
type ListObjectVersionsInput ¶
type ListObjectVersionsInput struct { Prefix string `location:"query" locationName:"prefix"` Delimiter string `location:"query" locationName:"delimiter"` KeyMarker string `location:"query" locationName:"key-marker"` VersionIDMarker string `location:"query" locationName:"version-id-marker"` MaxKeys int `location:"query" locationName:"max-keys"` EncodingType string `location:"query" locationName:"encoding-type"` // "" or "url" FetchMeta bool `location:"query" locationName:"fetch-meta"` }
type ListObjectVersionsOutput ¶
type ListObjectVersionsOutput struct { RequestInfo `json:"-"` Name string `json:"Name,omitempty"` // bucket name Prefix string `json:"Prefix,omitempty"` KeyMarker string `json:"KeyMarker,omitempty"` VersionIDMarker string `json:"VersionIdMarker,omitempty"` Delimiter string `json:"Delimiter,omitempty"` EncodingType string `json:"EncodingType,omitempty"` MaxKeys int64 `json:"MaxKeys,omitempty"` NextKeyMarker string `json:"NextKeyMarker,omitempty"` NextVersionIDMarker string `json:"NextVersionIdMarker,omitempty"` IsTruncated bool `json:"IsTruncated,omitempty"` CommonPrefixes []ListedCommonPrefix `json:"CommonPrefixes,omitempty"` Versions []ListedObjectVersion `json:"Versions,omitempty"` DeleteMarkers []ListedDeleteMarkerEntry `json:"DeleteMarkers,omitempty"` }
type ListObjectVersionsV2Input ¶
type ListObjectVersionsV2Input struct { Bucket string `json:"Prefix,omitempty"` ListObjectVersionsInput }
type ListObjectVersionsV2Output ¶
type ListObjectVersionsV2Output struct { RequestInfo `json:"-"` Name string `json:"Name,omitempty"` // bucket name Prefix string `json:"Prefix,omitempty"` KeyMarker string `json:"KeyMarker,omitempty"` VersionIDMarker string `json:"VersionIdMarker,omitempty"` Delimiter string `json:"Delimiter,omitempty"` EncodingType string `json:"EncodingType,omitempty"` MaxKeys int `json:"MaxKeys,omitempty"` NextKeyMarker string `json:"NextKeyMarker,omitempty"` NextVersionIDMarker string `json:"NextVersionIdMarker,omitempty"` IsTruncated bool `json:"IsTruncated,omitempty"` CommonPrefixes []ListedCommonPrefix `json:"CommonPrefixes,omitempty"` Versions []ListedObjectVersionV2 `json:"Versions,omitempty"` DeleteMarkers []ListedDeleteMarker `json:"DeleteMarkers,omitempty"` }
func ParseListObjectVersionsV2Output ¶ added in v2.4.7
func ParseListObjectVersionsV2Output(httpRes *http.Response) (*ListObjectVersionsV2Output, error)
ParseListObjectVersionsV2Output Parse the incoming parameters of *http.Response type, and respond to the return value of *ListObjectVersionsV2Output type.
type ListObjectsInput ¶
type ListObjectsInput struct { Prefix string `location:"query" locationName:"prefix"` Delimiter string `location:"query" locationName:"delimiter"` Marker string `location:"query" locationName:"marker"` MaxKeys int `location:"query" locationName:"max-keys"` EncodingType string `location:"query" locationName:"encoding-type"` // "" or "url" FetchMeta bool `location:"query" locationName:"fetch-meta"` // Deprecated Reverse bool }
type ListObjectsOutput ¶
type ListObjectsOutput struct { RequestInfo `json:"-"` Name string `json:"Name,omitempty"` // bucket name Prefix string `json:"Prefix,omitempty"` Marker string `json:"Marker,omitempty"` MaxKeys int64 `json:"MaxKeys,omitempty"` NextMarker string `json:"NextMarker,omitempty"` Delimiter string `json:"Delimiter,omitempty"` IsTruncated bool `json:"IsTruncated,omitempty"` EncodingType string `json:"EncodingType,omitempty"` CommonPrefixes []ListedCommonPrefix `json:"CommonPrefixes,omitempty"` Contents []ListedObject `json:"Contents,omitempty"` }
type ListObjectsType2Input ¶ added in v2.4.0
type ListObjectsType2Input struct { Bucket string Prefix string `location:"query" locationName:"prefix"` Delimiter string `location:"query" locationName:"delimiter"` StartAfter string `location:"query" locationName:"start-after"` ContinuationToken string `location:"query" locationName:"continuation-token"` MaxKeys int `location:"query" locationName:"max-keys"` EncodingType string `location:"query" locationName:"encoding-type"` FetchMeta bool `location:"query" locationName:"fetch-meta"` ListOnlyOnce bool }
type ListObjectsType2Output ¶ added in v2.4.0
type ListObjectsType2Output struct { RequestInfo Name string `json:"Name,omitempty"` Prefix string `json:"Prefix,omitempty"` ContinuationToken string `json:"ContinuationToken,omitempty"` KeyCount int `json:"KeyCount,omitempty"` MaxKeys int `json:"MaxKeys,omitempty"` Delimiter string `json:"Delimiter,omitempty"` IsTruncated bool `json:"IsTruncated,omitempty"` EncodingType string `json:"EncodingType,omitempty"` NextContinuationToken string `json:"NextContinuationToken,omitempty"` CommonPrefixes []ListedCommonPrefix `json:"CommonPrefixes,omitempty"` Contents []ListedObjectV2 `json:"Contents,omitempty"` }
func ParseListObjectsType2Output ¶ added in v2.4.7
func ParseListObjectsType2Output(httpRes *http.Response) (*ListObjectsType2Output, error)
ParseListObjectsType2Output Parse the incoming parameters of *http.Response type, and respond to the return value of *ListObjectsType2Output type.
type ListObjectsV2Input ¶
type ListObjectsV2Input struct { Bucket string ListObjectsInput }
type ListObjectsV2Output ¶
type ListObjectsV2Output struct { RequestInfo `json:"-"` Name string `json:"Name,omitempty"` Prefix string `json:"Prefix,omitempty"` Marker string `json:"Marker,omitempty"` MaxKeys int64 `json:"MaxKeys,omitempty"` NextMarker string `json:"NextMarker,omitempty"` Delimiter string `json:"Delimiter,omitempty"` IsTruncated bool `json:"IsTruncated,omitempty"` EncodingType string `json:"EncodingType,omitempty"` CommonPrefixes []ListedCommonPrefix `json:"CommonPrefixes,omitempty"` Contents []ListedObjectV2 `json:"Contents,omitempty"` }
func ParseListObjectsV2Output ¶ added in v2.4.8
func ParseListObjectsV2Output(httpRes *http.Response) (*ListObjectsV2Output, error)
ParseListObjectsV2Output Parse the incoming parameters of *http.Response type, and respond to the return value of *ListObjectsV2Output type.
type ListPartsInput ¶
type ListPartsInput struct { Bucket string Key string UploadID string `location:"query" locationName:"uploadId"` PartNumberMarker int `location:"query" locationName:"part-number-marker"` MaxParts int `location:"query" locationName:"max-parts"` EncodingType string `location:"query" locationName:"encoding-type"` // "" or "url" }
type ListPartsOutput ¶
type ListPartsOutput struct { RequestInfo Bucket string Key string UploadID string PartNumberMarker int MaxParts int IsTruncated bool EncodingType string NextPartNumberMarker int StorageClass enum.StorageClassType Owner Owner Parts []UploadedPartV2 }
type ListUploadedPartsInput ¶
type ListUploadedPartsOutput ¶
type ListUploadedPartsOutput struct { RequestInfo `json:"-"` Bucket string `json:"Bucket,omitempty"` // Bucket名称 Key string `json:"Key,omitempty"` // Object名称 UploadID string `json:"UploadId,omitempty"` // 上传ID PartNumberMarker int `json:"PartNumberMarker,omitempty"` // 当前页起始位置 NextPartNumberMarker int `json:"NextPartNumberMarker,omitempty"` // 下一个Part的位置 MaxParts int `json:"MaxParts,omitempty"` // 最大Part个数 IsTruncated bool `json:"IsTruncated,omitempty"` // 是否完全上传完成 StorageClass string `json:"StorageClass,omitempty"` // 存储类型 Owner Owner `json:"Owner,omitempty"` // 属主 UploadedParts []UploadedPart `json:"Parts,omitempty"` // 已完成的Part }
type ListedBucket ¶
type ListedBucket struct { CreationDate string `json:"CreationDate,omitempty"` Name string `json:"Name,omitempty"` Location string `json:"Location,omitempty"` ExtranetEndpoint string `json:"ExtranetEndpoint,omitempty"` IntranetEndpoint string `json:"IntranetEndpoint,omitempty"` ProjectName string `json:"ProjectName,omitempty"` BucketType enum.BucketType `json:"BucketType,omitempty"` }
type ListedCommonPrefix ¶
type ListedCommonPrefix struct {
Prefix string `json:"Prefix,omitempty"`
}
type ListedDeleteMarker ¶
type ListedDeleteMarkerEntry ¶
type ListedObject ¶
type ListedObject struct { Key string `json:"Key,omitempty"` LastModified string `json:"LastModified,omitempty"` ETag string `json:"ETag,omitempty"` Size int64 `json:"Size,omitempty"` Owner Owner `json:"Owner,omitempty"` StorageClass string `json:"StorageClass,omitempty"` Type string `json:"Type,omitempty"` Meta Metadata `json:"UserMeta,omitempty"` HashCrc64ecma uint64 `json:"HashCrc64Ecma,omitempty"` ObjectType string `json:"Type,omitempty"` }
type ListedObjectV2 ¶ added in v2.1.3
type ListedObjectVersion ¶
type ListedObjectVersion struct { ETag string `json:"ETag,omitempty"` IsLatest bool `json:"IsLatest,omitempty"` Key string `json:"Key,omitempty"` LastModified string `json:"LastModified,omitempty"` Owner Owner `json:"Owner,omitempty"` Size int64 `json:"Size,omitempty"` StorageClass string `json:"StorageClass,omitempty"` Type string `json:"Type,omitempty"` VersionID string `json:"VersionId,omitempty"` Meta Metadata `json:"UserMeta,omitempty"` ObjectType string `json:"Type,omitempty"` HashCrc64ecma uint64 `json:"HashCrc64Ecma,omitempty"` }
type ListedObjectVersionV2 ¶ added in v2.1.3
type ListedOwner ¶
type ListedOwner struct {
ID string `json:"ID,omitempty"`
}
type ListedUpload ¶
type Logger ¶ added in v2.3.0
type Logger interface { Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) }
type MirrorBackRule ¶ added in v2.4.0
type MirrorHeader ¶ added in v2.4.0
type MirrorHeader struct { PassAll bool `json:"PassAll,omitempty"` Pass []string `json:"Pass,omitempty"` Remove []string `json:"Remove,omitempty"` Set []MirrorHeaderKeyValue `json:"Set,omitempty"` }
type MirrorHeaderKeyValue ¶ added in v2.7.2
type MultipartUploadedPart ¶
type MultipartUploadedPart interface {
// contains filtered or unexported methods
}
type NoCurrentVersionExpiration ¶ added in v2.4.0
type NoCurrentVersionExpiration struct {
NoCurrentDays int `json:"NoncurrentDays,omitempty"`
}
type NoRetryClassifier ¶
type NoRetryClassifier struct{}
func (NoRetryClassifier) Classify ¶
func (classifier NoRetryClassifier) Classify(_ error) retryAction
Classify implements the classifier interface.
type NonCurrentVersionTransition ¶ added in v2.4.0
type NonCurrentVersionTransition struct { NonCurrentDays int `json:"NoncurrentDays,omitempty"` StorageClass enum.StorageClassType `json:"StorageClass,omitempty"` }
type NotificationDestination ¶ added in v2.6.6
type NotificationDestination struct { RocketMQ []DestinationRocketMQ `json:"RocketMQ"` VeFaaS []DestinationVeFaaS `json:"VeFaaS"` }
type NotificationFilter ¶ added in v2.6.6
type NotificationFilter struct {
TOSKey NotificationFilterKey `json:"TOSKey"`
}
type NotificationFilterKey ¶ added in v2.6.6
type NotificationFilterKey struct {
FilterRules []NotificationFilterRule `json:"FilterRules"`
}
type NotificationFilterRule ¶ added in v2.6.6
type NotificationRule ¶ added in v2.6.6
type NotificationRule struct { RuleID string `json:"RuleId"` Events []string `json:"Events"` // 支持的值在不断增加,不定义成枚举 Filter NotificationFilter `json:"Filter"` Destination NotificationDestination `json:"Destination"` }
type ObjectAclGrant ¶
type ObjectAclGrant struct { ACL string `json:"ACL,omitempty"` GrantFullControl string `json:"GrantFullControl,omitempty"` GrantRead string `json:"GrantRead,omitempty"` GrantReadAcp string `json:"GrantReadAcp,omitempty"` // Deprecated: GrantWrite will be ignored GrantWrite string `json:"GrantWrite,omitempty"` GrantWriteAcp string `json:"GrantWriteAcp,omitempty"` }
type ObjectAclRules ¶
type ObjectMeta ¶
type ObjectMeta struct { ContentLength int64 `json:"ContentLength,omitempty"` ContentType string `json:"ContentType,omitempty"` ContentMD5 string `json:"ContentMD5,omitempty"` ContentLanguage string `json:"ContentLanguage,omitempty"` ContentEncoding string `json:"ContentEncoding,omitempty"` ContentDisposition string `json:"ContentDisposition,omitempty"` LastModified string `json:"LastModified,omitempty"` CacheControl string `json:"CacheControl,omitempty"` Expires string `json:"Expires,omitempty"` ETag string `json:"ETag,omitempty"` VersionID string `json:"VersionId,omitempty"` DeleteMarker bool `json:"DeleteMarker,omitempty"` ObjectType string `json:"ObjectType,omitempty"` // "" or "Appendable" StorageClass string `json:"StorageClass,omitempty"` RestoreInfo *RestoreInfo `json:"Restore,omitempty"` Metadata map[string]string `json:"Metadata,omitempty"` Tag string `json:"Tag,omitempty"` SSECustomerAlgorithm string `json:"SSECustomerAlgorithm,omitempty"` SSECustomerKeyMD5 string `json:"SSECustomerKeyMD5,omitempty"` CSType string `json:"CSType,omitempty"` IsDirectory bool `json:"IsDirectory"` }
ObjectMeta object metadata
type ObjectMetaV2 ¶
type ObjectMetaV2 struct { ETag string LastModified time.Time DeleteMarker bool SSECAlgorithm string SSECKeyMD5 string VersionID string WebsiteRedirectLocation string ObjectType string HashCrc64ecma uint64 StorageClass enum.StorageClassType Meta Metadata ContentLength int64 ContentType string CacheControl string ContentDisposition string ContentEncoding string ContentLanguage string Expires time.Time ServerSideEncryption string ServerSideEncryptionKeyID string ReplicationStatus enum.ReplicationStatusType RestoreInfo *RestoreInfo `json:"Restore,omitempty"` IsDirectory bool Expiration string TaggingCount int64 }
type ObjectTobeDeleted ¶
type Option ¶
type Option func(*requestBuilder)
func WithACL ¶
WithACL set X-Tos-Acl header
used in Bucket.PutObject Bucket.CreateMultipartUpload Bucket.AppendObject
func WithACLGrantFullControl ¶
WithACLGrantFullControl X-Tos-Grant-Full-Control header
used in Bucket.PutObject Bucket.CreateMultipartUpload Bucket.AppendObject
func WithACLGrantRead ¶
WithACLGrantRead set X-Tos-Grant-Read header
used in Bucket.PutObject Bucket.CreateMultipartUpload Bucket.AppendObject
func WithACLGrantReadAcp ¶
WithACLGrantReadAcp set X-Tos-Grant-Read-Acp header
used in Bucket.PutObject Bucket.CreateMultipartUpload Bucket.AppendObject
func WithACLGrantWrite ¶
WithACLGrantWrite set X-Tos-Grant-Write header
used in Bucket.PutObject Bucket.CreateMultipartUpload Bucket.AppendObject
func WithACLGrantWriteAcp ¶
WithACLGrantWriteAcp set X-Tos-Grant-Write-Acp header
used in Bucket.PutObject Bucket.CreateMultipartUpload Bucket.AppendObject
func WithCacheControl ¶
WithCacheControl set Cache-Control header
used in Bucket.PutObject Bucket.AppendObject Bucket.CreateMultipartUpload Bucket.SetObjectMeta
func WithContentDisposition ¶
WithContentDisposition set Content-Disposition header
used in Bucket.PutObject Bucket.AppendObject Bucket.CreateMultipartUpload Bucket.SetObjectMeta
func WithContentEncoding ¶
WithContentEncoding set Content-Encoding header
used in Bucket.PutObject Bucket.AppendObject Bucket.CreateMultipartUpload Bucket.SetObjectMeta
func WithContentLanguage ¶
WithContentLanguage set Content-Language header
used in Bucket.PutObject Bucket.AppendObject Bucket.CreateMultipartUpload Bucket.SetObjectMeta
func WithContentLength ¶
WithContentLength set Content-Length header
used in Bucket.PutObject Bucket.AppendObject Bucket.UploadPart
If the length of the content is known, it is better to add this option when Put, Append or Upload.
func WithContentMD5 ¶
WithContentMD5 set Content-MD5 header
func WithContentSHA256 ¶
WithContentSHA256 set X-Tos-Content-Sha256 header
func WithContentType ¶
WithContentType set Content-Type header
used in Bucket.PutObject Bucket.AppendObject Bucket.CreateMultipartUpload Bucket.SetObjectMeta
func WithCopySourceIfMatch ¶
WithCopySourceIfMatch set X-Tos-Copy-Source-If-Match header
used in Bucket.CopyObject Bucket.CopyObjectTo Bucket.CopyObjectFrom Bucket.UploadPartCopy
func WithCopySourceIfModifiedSince ¶
WithCopySourceIfModifiedSince set X-Tos-Copy-Source-If-Modified-Since header
used in Bucket.CopyObject Bucket.CopyObjectTo Bucket.CopyObjectFrom Bucket.UploadPartCopy
func WithCopySourceIfNoneMatch ¶
WithCopySourceIfNoneMatch set X-Tos-Copy-Source-If-None-Match
used in Bucket.CopyObject Bucket.CopyObjectTo Bucket.CopyObjectFrom Bucket.UploadPartCopy
func WithCopySourceIfUnmodifiedSince ¶
WithCopySourceIfUnmodifiedSince set X-Tos-Copy-Source-If-Unmodified-Since header
used in Bucket.CopyObject Bucket.CopyObjectTo Bucket.CopyObjectFrom Bucket.UploadPartCopy
func WithExpires ¶
WithExpires set Expires header
used in Bucket.PutObject Bucket.AppendObject Bucket.CreateMultipartUpload Bucket.SetObjectMeta
func WithIfModifiedSince ¶
WithIfModifiedSince set If-Modified-Since header
used in Bucket.GetObject Bucket.HeadObject
func WithIfNoneMatch ¶
WithIfNoneMatch set If-None-Match header
func WithIfUnmodifiedSince ¶
WithIfUnmodifiedSince set If-Unmodified-Since header
used in Bucket.GetObject Bucket.HeadObject
func WithMeta ¶
WithMeta set meta header
used in Bucket.PutObject Bucket.CreateMultipartUpload Bucket.AppendObject Bucket.SetObjectMeta
func WithMetadataDirective ¶
WithMetadataDirective set X-Tos-Metadata-Directive header
used in Bucket.CopyObject Bucket.CopyObjectTo Bucket.CopyObjectFrom
func WithPerRequestSigner ¶
WithPerRequestSigner set Signer for a request
use this option when you need set request-level signature parameter(s). for example, use different ak and sk for each request.
if 'signer' set to nil, the request will not be signed.
func WithServerSideEncryptionCustomer ¶
WithServerSideEncryptionCustomer set server-side-encryption parameters
used in Bucket.PutObject Bucket.CreateMultipartUpload
func WithVersionID ¶
WithVersionID set version parameter
used in Bucket.GetObject Bucket.HeadObject Bucket.DeleteObject Bucket.GetObjectAcl Bucket.SetObjectMeta Bucket.CopyObject Bucket.CopyObjectTo Bucket.CopyObjectFrom Client.PreSignedURL
func WithWebsiteRedirectLocation ¶
WithWebsiteRedirectLocation set X-Tos-Website-Redirect-Location header
type PolicySignatureCondition ¶ added in v2.4.5
type PostSignatureCondition ¶ added in v2.4.0
type PreSignedPolicyURLGenerator ¶ added in v2.4.5
type PreSignedURLInput ¶
type PreSignedURLOutput ¶
type PreSingedPolicyURLInput ¶ added in v2.4.5
type PreSingedPolicyURLInput struct { Bucket string Expires int64 Conditions []PolicySignatureCondition AlternativeEndpoint string IsCustomDomain bool }
type PreSingedPolicyURLOutput ¶ added in v2.4.5
type PreSingedPolicyURLOutput struct { PreSignedPolicyURLGenerator SignatureQuery string // contains filtered or unexported fields }
func (*PreSingedPolicyURLOutput) GetSignedURLForGetOrHead ¶ added in v2.4.5
func (output *PreSingedPolicyURLOutput) GetSignedURLForGetOrHead(key string, additionalQuery map[string]string) string
func (*PreSingedPolicyURLOutput) GetSignedURLForList ¶ added in v2.4.5
func (output *PreSingedPolicyURLOutput) GetSignedURLForList(additionalQuery map[string]string) string
type PreSingedPostSignatureInput ¶ added in v2.4.0
type PreSingedPostSignatureInput struct { Bucket string Key string Expires int64 Conditions []PostSignatureCondition ContentLengthRange *ContentLengthRange }
type PreSingedPostSignatureOutput ¶ added in v2.4.0
type PrivateSource ¶ added in v2.7.2
type PrivateSource struct {
SourceEndpoint CommonSourceEndpoint
}
type PublicSource ¶ added in v2.4.0
type PublicSource struct { SourceEndpoint SourceEndpoint `json:"SourceEndpoint,omitempty"` FixedEndpoint bool `json:"FixedEndpoint,omitempty"` }
type PutBucketACLInput ¶ added in v2.4.0
type PutBucketACLInput struct { Bucket string ACLType enum.ACLType `location:"header" locationName:"X-Tos-Acl"` // optional GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional GrantWrite string `location:"header" locationName:"X-Tos-Grant-Write"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional Owner Owner `json:"Owner,omitempty"` Grants []GrantV2 `json:"Grants,omitempty"` BucketAclDelivered bool `json:"BucketAclDelivered,omitempty"` }
type PutBucketACLOutput ¶ added in v2.4.0
type PutBucketACLOutput struct {
RequestInfo
}
type PutBucketCORSInput ¶ added in v2.1.10
type PutBucketCORSOutput ¶ added in v2.1.10
type PutBucketCORSOutput struct {
RequestInfo `json:"-"`
}
type PutBucketCustomDomainInput ¶ added in v2.5.0
type PutBucketCustomDomainInput struct { Bucket string Rule CustomDomainRule }
type PutBucketCustomDomainOutput ¶ added in v2.5.0
type PutBucketCustomDomainOutput struct {
RequestInfo
}
type PutBucketEncryptionInput ¶ added in v2.7.0
type PutBucketEncryptionInput struct { Bucket string `json:"-"` Rule BucketEncryptionRule `json:"Rule"` }
type PutBucketEncryptionOutput ¶ added in v2.7.0
type PutBucketEncryptionOutput struct {
RequestInfo
}
Response
type PutBucketLifecycleInput ¶ added in v2.4.0
type PutBucketLifecycleInput struct { Bucket string Rules []LifecycleRule `json:"Rules,omitempty"` AllowSameActionOverlap bool `location:"header" locationName:"X-Tos-Allow-Same-Action-Overlap"` }
type PutBucketMirrorBackInput ¶ added in v2.4.0
type PutBucketMirrorBackInput struct { Bucket string Rules []MirrorBackRule }
type PutBucketMirrorBackOutput ¶ added in v2.4.0
type PutBucketMirrorBackOutput struct {
RequestInfo
}
type PutBucketNotificationInput ¶ added in v2.5.0
type PutBucketNotificationInput struct { Bucket string `json:"-"` CloudFunctionConfigurations []CloudFunctionConfiguration `json:"CloudFunctionConfigurations"` RocketMQConfigurations []RocketMQConfiguration `json:"RocketMQConfigurations"` }
type PutBucketNotificationOutput ¶ added in v2.5.0
type PutBucketNotificationOutput struct {
RequestInfo
}
type PutBucketNotificationType2Input ¶ added in v2.6.6
type PutBucketNotificationType2Input struct { Bucket string Rules []NotificationRule `json:"Rules"` Version string `json:"Version"` }
type PutBucketNotificationType2Output ¶ added in v2.6.6
type PutBucketNotificationType2Output struct {
RequestInfo
}
type PutBucketPolicyOutput ¶
type PutBucketPolicyOutput struct {
RequestInfo `json:"-"`
}
type PutBucketPolicyV2Input ¶ added in v2.4.0
type PutBucketPolicyV2Output ¶ added in v2.4.0
type PutBucketPolicyV2Output struct {
RequestInfo `json:"-"`
}
type PutBucketRealTimeLogInput ¶ added in v2.5.0
type PutBucketRealTimeLogInput struct { Bucket string Configuration RealTimeLogConfiguration }
type PutBucketRealTimeLogOutput ¶ added in v2.5.0
type PutBucketRealTimeLogOutput struct {
RequestInfo
}
type PutBucketRenameInput ¶ added in v2.5.4
type PutBucketRenameOutput ¶ added in v2.5.4
type PutBucketRenameOutput struct {
RequestInfo
}
type PutBucketReplicationInput ¶ added in v2.5.0
type PutBucketReplicationInput struct { Bucket string Role string Rules []ReplicationRule }
type PutBucketReplicationOutput ¶ added in v2.5.0
type PutBucketReplicationOutput struct {
RequestInfo
}
type PutBucketStorageClassInput ¶ added in v2.4.0
type PutBucketStorageClassInput struct { Bucket string StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` }
type PutBucketStorageClassOutput ¶ added in v2.4.0
type PutBucketStorageClassOutput struct {
RequestInfo
}
type PutBucketTaggingInput ¶ added in v2.6.6
type PutBucketTaggingOutput ¶ added in v2.6.6
type PutBucketTaggingOutput struct {
RequestInfo
}
type PutBucketVersioningInput ¶ added in v2.5.0
type PutBucketVersioningInput struct { Bucket string Status enum.VersioningStatusType }
type PutBucketVersioningOutput ¶ added in v2.5.0
type PutBucketVersioningOutput struct {
RequestInfo
}
type PutBucketWebsiteInput ¶ added in v2.5.0
type PutBucketWebsiteInput struct { Bucket string RedirectAllRequestsTo *RedirectAllRequestsTo `json:"RedirectAllRequestsTo,omitempty"` IndexDocument *IndexDocument `json:"IndexDocument,omitempty"` ErrorDocument *ErrorDocument `json:"ErrorDocument,omitempty"` RoutingRules *RoutingRules `json:"RoutingRules,omitempty"` }
type PutBucketWebsiteOutput ¶ added in v2.5.0
type PutBucketWebsiteOutput struct {
RequestInfo
}
type PutFetchTaskInput ¶ added in v2.1.8
type PutFetchTaskInput struct { URL string `json:"URL,omitempty"` // required Object string `json:"Object,omitempty"` // object key, required IgnoreSameKey bool `json:"IgnoreSameKey,omitempty"` // optional, default value is false ContentMD5 string `json:"ContentMD5,omitempty"` // hex-encoded md5, optional }
type PutFetchTaskInputV2 ¶ added in v2.4.0
type PutFetchTaskInputV2 struct { Bucket string Key string ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` GrantReadACP string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` GrantWriteACP string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` Meta map[string]string `location:"headers"` URL string `json:"URL,omitempty"` IgnoreSameKey bool `json:"IgnoreSameKey,omitempty"` // Deprecated: use content md5 instead HexMD5 string ContentMD5 string `json:"ContentMD5,omitempty"` CallbackUrl string `json:"CallbackUrl,omitempty"` CallbackHost string `json:"CallbackHost,omitempty"` CallbackBodyType string `json:"CallbackBodyType,omitempty"` CallbackBody string `json:"CallbackBody,omitempty"` }
type PutFetchTaskOutput ¶ added in v2.1.8
type PutFetchTaskOutput struct { RequestInfo `json:"-"` TaskID string `json:"TaskId,omitempty"` }
type PutFetchTaskOutputV2 ¶ added in v2.4.0
type PutFetchTaskOutputV2 struct { RequestInfo TaskID string }
type PutLifecycleOutput ¶ added in v2.4.0
type PutLifecycleOutput struct {
RequestInfo
}
type PutObjectACLInput ¶
type PutObjectACLInput struct { Bucket string Key string // the object, required VersionID string `location:"query" locationName:"versionId"` // optional ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` // optional GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional // Deprecated GrantWrite string `location:"header" locationName:"X-Tos-Grant-Write"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional Owner Owner Grants []GrantV2 BucketOwnerEntrusted bool IsDefault bool }
type PutObjectACLOutput ¶
type PutObjectACLOutput struct {
PutObjectAclOutput
}
type PutObjectAclInput ¶
type PutObjectAclInput struct { Key string `json:"Key,omitempty"` // the object, required VersionID string `json:"VersionId,omitempty"` // the version id of the object, optional AclGrant *ObjectAclGrant `json:"AclGrant,omitempty"` // set acl by header AclRules *ObjectAclRules `json:"AclRules,omitempty"` // set acl by rules }
PutObjectAclInput AclGrant, AclRules can not set both.
type PutObjectAclOutput ¶
type PutObjectAclOutput struct {
RequestInfo `json:"-"`
}
type PutObjectBasicInput ¶
type PutObjectBasicInput struct { Bucket string Key string ContentLength int64 `location:"header" locationName:"Content-Length"` ContentMD5 string `location:"header" locationName:"Content-MD5"` ContentSHA256 string `location:"header" locationName:"X-Tos-Content-Sha256"` CacheControl string `location:"header" locationName:"Cache-Control"` ContentDisposition string `location:"header" locationName:"Content-Disposition" encodeChinese:"true"` ContentEncoding string `location:"header" locationName:"Content-Encoding"` ContentLanguage string `location:"header" locationName:"Content-Language"` ContentType string `location:"header" locationName:"Content-Type"` Expires time.Time `location:"header" locationName:"Expires"` ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` GrantFullControl string `location:"header" locationName:"X-Tos-Grant-Full-Control"` // optional GrantRead string `location:"header" locationName:"X-Tos-Grant-Read"` // optional GrantReadAcp string `location:"header" locationName:"X-Tos-Grant-Read-Acp"` // optional GrantWriteAcp string `location:"header" locationName:"X-Tos-Grant-Write-Acp"` // optional Callback string `location:"header" locationName:"X-Tos-Callback"` CallbackVar string `location:"header" locationName:"X-Tos-Callback-Var"` WebsiteRedirectLocation string `location:"header" locationName:"X-Tos-Website-Redirect-Location"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` ServerSideEncryption string `location:"header" locationName:"X-Tos-Server-Side-Encryption"` ServerSideEncryptionKeyID string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Kms-Key-Id"` TrafficLimit int64 `location:"header" locationName:"X-Tos-Traffic-Limit"` ForbidOverwrite bool `location:"header" locationName:"X-Tos-Forbid-Overwrite"` IfMatch string `location:"header" locationName:"X-Tos-If-Match"` Tagging string `location:"header" locationName:"X-Tos-Tagging"` ObjectExpires int64 `location:"header" locationName:"X-Tos-Object-Expires"` Meta map[string]string `location:"headers"` DataTransferListener DataTransferListener RateLimiter RateLimiter }
type PutObjectFromFileInput ¶
type PutObjectFromFileInput struct { PutObjectBasicInput FilePath string }
type PutObjectFromFileOutput ¶
type PutObjectFromFileOutput struct {
PutObjectV2Output
}
type PutObjectOutput ¶
type PutObjectOutput struct { RequestInfo `json:"-"` ETag string `json:"ETag,omitempty"` VersionID string `json:"VersionId,omitempty"` SSECustomerAlgorithm string `json:"SSECustomerAlgorithm,omitempty"` SSECustomerKeyMD5 string `json:"SSECustomerKeyMD5,omitempty"` }
type PutObjectTaggingInput ¶ added in v2.4.0
type PutObjectTaggingOutput ¶ added in v2.4.0
type PutObjectTaggingOutput struct { RequestInfo VersionID string }
type PutObjectV2Input ¶
type PutObjectV2Input struct { PutObjectBasicInput Content io.Reader }
type PutObjectV2Output ¶
type PutSymlinkInput ¶ added in v2.7.4
type PutSymlinkInput struct { Bucket string Key string SymlinkTargetKey string SymlinkTargetBucket string `location:"header" locationName:"X-Tos-Symlink-Bucket"` ForbidOverwrite bool `location:"header" locationName:"X-Tos-Forbid-Overwrite"` ACL enum.ACLType `location:"header" locationName:"X-Tos-Acl"` StorageClass enum.StorageClassType `location:"header" locationName:"X-Tos-Storage-Class"` Tagging string `location:"header" locationName:"X-Tos-Tagging"` ContentType string `location:"header" locationName:"Content-Type"` Expires time.Time `location:"header" locationName:"Expires"` CacheControl string `location:"header" locationName:"Cache-Control"` ContentDisposition string `location:"header" locationName:"Content-Disposition" encodeChinese:"true"` ContentLanguage string `location:"header" locationName:"Content-Language"` Meta map[string]string `location:"headers"` }
type PutSymlinkOutput ¶ added in v2.7.4
type PutSymlinkOutput struct { RequestInfo VersionID string }
type RateLimiter ¶
type RateLimiter interface { // Acquire try to get a token. // If ok, caller can read want bytes, else wait timeToWait and try again. Acquire(want int64) (ok bool, timeToWait time.Duration) }
func NewDefaultRateLimit ¶ added in v2.5.0
func NewDefaultRateLimit(rate int64, capacity int64) RateLimiter
type ReadCloserWithLimiter ¶
type ReadCloserWithLimiter struct {
// contains filtered or unexported fields
}
ReadCloserWithLimiter warp io.ReadCloser with DataTransferListener
func (*ReadCloserWithLimiter) Close ¶
func (r *ReadCloserWithLimiter) Close() error
type RealTimeLogConfiguration ¶ added in v2.5.0
type RealTimeLogConfiguration struct { Role string `json:"Role"` Configuration AccessLogConfiguration `json:"AccessLogConfiguration"` }
type Redirect ¶ added in v2.4.0
type Redirect struct { RedirectType enum.RedirectType `json:"RedirectType,omitempty"` FetchSourceOnRedirect bool `json:"FetchSourceOnRedirect,omitempty"` PassQuery bool `json:"PassQuery,omitempty"` FollowRedirect bool `json:"FollowRedirect,omitempty"` MirrorHeader MirrorHeader `json:"MirrorHeader,omitempty"` PublicSource PublicSource `json:"PublicSource,omitempty"` Transform Transform `json:"Transform,omitempty"` FetchHeaderToMetaDataRules []FetchHeaderToMetaDataRule `json:"FetchHeaderToMetaDataRules,omitempty"` PrivateSource *PrivateSource `json:"PrivateSource,omitempty"` FetchSourceOnRedirectWithQuery *bool `json:"FetchSourceOnRedirectWithQuery,omitempty"` }
type RedirectAllRequestsTo ¶ added in v2.5.0
type RenameObjectInput ¶ added in v2.5.4
type RenameObjectOutput ¶ added in v2.5.4
type RenameObjectOutput struct {
RequestInfo
}
type ReplaceKeyPrefix ¶ added in v2.6.0
type ReplicationRule ¶ added in v2.5.0
type ReplicationRule struct { ID string `json:"ID"` Status enum.StatusType `json:"Status"` PrefixSet []string `json:"PrefixSet,omitempty"` Destination Destination `json:"Destination"` HistoricalObjectReplication enum.StatusType `json:"HistoricalObjectReplication"` }
type ReplicationRuleWithProgress ¶ added in v2.5.0
type ReplicationRuleWithProgress struct { ReplicationRule Progress *Progress `json:"Progress,omitempty"` }
type Request ¶
type Request struct { Scheme string Method string Host string Path string ContentLength *int64 Content io.Reader Query url.Values Header http.Header RequestDate time.Time // 不为空时,代表本次请求 Header 中指定的 X-Tos-Date 头域(转换为 UTC 时间),包含签名时和发送时 RequestHost string // 不为空时,代表本次请求 Header 中指定的 Host 头域,仅影响签名和发送请求时的 Host 头域,实际建立仍使用 Endpoint // contains filtered or unexported fields }
type RequestInfo ¶
type Response ¶
type Response struct { StatusCode int ContentLength int64 Header http.Header Body io.ReadCloser RequestUrl string }
func (*Response) RequestInfo ¶
func (r *Response) RequestInfo() RequestInfo
type RestoreInfo ¶ added in v2.7.0
type RestoreInfo struct { RestoreStatus RestoreStatus RestoreParam *RestoreParam // GetObject 接口当前该值为空 }
type RestoreJobParameters ¶ added in v2.6.0
type RestoreObjectInput ¶ added in v2.6.0
type RestoreObjectInput struct { Bucket string Key string VersionID string `location:"query" locationName:"versionId"` Days int RestoreJobParameters *RestoreJobParameters }
type RestoreObjectOutput ¶ added in v2.6.0
type RestoreObjectOutput struct {
RequestInfo
}
type RestoreParam ¶ added in v2.7.0
type RestoreStatus ¶ added in v2.7.0
type ResumableCopyObjectInput ¶ added in v2.5.0
type ResumableCopyObjectInput struct { CreateMultipartUploadV2Input SrcBucket string SrcKey string SrcVersionID string CopySourceIfMatch string CopySourceIfModifiedSince time.Time CopySourceIfNoneMatch string CopySourceIfUnmodifiedSince time.Time CopySourceSSECAlgorithm string CopySourceSSECKey string CopySourceSSECKeyMD5 string PartSize int64 TaskNum int EnableCheckpoint bool CheckpointFile string TrafficLimit int64 CopyEventListener CopyEventListener CancelHook CancelHook }
type ResumableCopyObjectOutput ¶ added in v2.5.0
type RocketMQConf ¶ added in v2.5.5
type RocketMQConfiguration ¶ added in v2.5.5
type RocketMQConfiguration struct { ID string `json:"RuleId"` Role string `json:"Role"` Events []string `json:"Events"` Filter Filter `json:"Filter"` RocketMQ RocketMQConf `json:"RocketMQ"` }
type RoutingRule ¶ added in v2.5.0
type RoutingRule struct { Condition RoutingRuleCondition `json:"Condition"` Redirect RoutingRuleRedirect `json:"Redirect"` }
type RoutingRuleCondition ¶ added in v2.5.0
type RoutingRuleRedirect ¶ added in v2.5.0
type RoutingRuleRedirect struct { Protocol enum.ProtocolType `json:"Protocol,omitempty"` HostName string `json:"HostName,omitempty"` ReplaceKeyPrefixWith string `json:"ReplaceKeyPrefixWith,omitempty"` ReplaceKeyWith string `json:"ReplaceKeyWith,omitempty"` HttpRedirectCode int `json:"HttpRedirectCode,omitempty"` }
type RoutingRules ¶ added in v2.5.0
type RoutingRules struct {
Rules []RoutingRule `json:"RoutingRules,omitempty"`
}
type SSEHeaders ¶
type SSEHeaders struct { SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` ServerSideEncryption string `location:"header" locationName:"X-Tos-Server-Side-Encryption"` }
type SerializeError ¶
type SerializeError struct { RequestID string `json:"RequestId,omitempty"` Message string `json:"Message,omitempty"` }
func (*SerializeError) Error ¶
func (se *SerializeError) Error() string
type ServerErrorClassifier ¶
type ServerErrorClassifier struct{}
ServerErrorClassifier classify errors returned by POST method. If the error is nil, it returns NoRetry; if the error can be interpreted as TosServerError and its StatusCode is 5xx or 429, it returns Retry; otherwise, it returns NoRetry.
func (ServerErrorClassifier) Classify ¶
func (classifier ServerErrorClassifier) Classify(err error) retryAction
Classify implements the classifier interface.
type SetObjectMetaInput ¶
type SetObjectMetaInput struct { Bucket string Key string VersionID string `location:"query" locationName:"versionId"` CacheControl string `location:"header" locationName:"Cache-Control"` ContentDisposition string `location:"header" locationName:"Content-Disposition"` ContentEncoding string `location:"header" locationName:"Content-Encoding"` ContentLanguage string `location:"header" locationName:"Content-Language"` ContentType string `location:"header" locationName:"Content-Type"` Expires time.Time `location:"header" locationName:"Expires"` ObjectExpires int64 `location:"header" locationName:"X-Tos-Object-Expires"` Meta map[string]string `location:"headers"` }
type SetObjectMetaOutput ¶
type SetObjectMetaOutput struct {
RequestInfo `json:"-"`
}
type SignV4 ¶
type SignV4 struct {
// contains filtered or unexported fields
}
func NewSignV4 ¶
func NewSignV4(credentials Credentials, region string) *SignV4
NewSignV4 create SignV4 use WithSignKey to set self-defined sign-key generator use WithSignLogger to set logger
func (*SignV4) WithSignLogger ¶ added in v2.2.0
func (*SignV4) WithSigningKey ¶
func (sv *SignV4) WithSigningKey(signingKey func(*SigningKeyInfo) []byte)
WithSigningKey for self-defined sign-key generator
type SignV4Option ¶ added in v2.2.0
type SignV4Option func(*SignV4)
type SigningKeyInfo ¶
type SigningKeyInfo struct { Date string Region string Credential *Credential }
type SourceEndpoint ¶ added in v2.4.0
type StaticCredentials ¶
type StaticCredentials struct {
// contains filtered or unexported fields
}
StaticCredentials Credentials with static access-key and secret-key
func NewStaticCredentials ¶
func NewStaticCredentials(accessKeyID, accessKeySecret string) *StaticCredentials
NewStaticCredentials Credentials with static access-key and secret-key
use StaticCredentials.WithSecurityToken to set security-token
you can use it as:
client, err := tos.NewClient(endpoint, tos.WithCredentials(tos.NewStaticCredentials(accessKey, secretKey))) // do something more
And you can use tos.WithPerRequestSigner set the 'Signer' for each request.
func (*StaticCredentials) Credential ¶
func (sc *StaticCredentials) Credential() Credential
func (*StaticCredentials) WithSecurityToken ¶
func (sc *StaticCredentials) WithSecurityToken(securityToken string)
WithSecurityToken set security-token
type StatusCodeClassifier ¶
type StatusCodeClassifier struct{}
StatusCodeClassifier classifies Errors. If the error is nil, it returns NoRetry; if the error is TimeoutException or can be interpreted as TosServerError, and the StatusCode is 5xx or 429, it returns Retry; otherwise, it returns NoRetry.
func (StatusCodeClassifier) Classify ¶
func (classifier StatusCodeClassifier) Classify(err error) retryAction
Classify implements the classifier interface.
type TimeoutConn ¶
func NewTimeoutConn ¶
func NewTimeoutConn(conn net.Conn, readTimeout, writeTimeout time.Duration) *TimeoutConn
type TimeoutDialer ¶
type TimeoutDialer struct { net.Dialer ReadTimeout time.Duration WriteTimeout time.Duration // contains filtered or unexported fields }
func (*TimeoutDialer) DialContext ¶
type TosClientError ¶
type TosServerError ¶
type Transform ¶ added in v2.6.0
type Transform struct { WithKeyPrefix string `json:"WithKeyPrefix,omitempty"` WithKeySuffix string `json:"WithKeySuffix,omitempty"` ReplaceKeyPrefix ReplaceKeyPrefix `json:"ReplaceKeyPrefix,omitempty"` }
type Transition ¶ added in v2.4.0
type Transition struct { Days int `json:"Days,omitempty"` Date time.Time `json:"Date,omitempty"` StorageClass enum.StorageClassType `json:"StorageClass,omitempty"` }
type TransportConfig ¶
type TransportConfig struct { // MaxIdleConns same as http.Transport MaxIdleConns. Default is 1024. MaxIdleConns int // MaxIdleConnsPerHost same as http.Transport MaxIdleConnsPerHost. Default is 1024. MaxIdleConnsPerHost int // MaxConnsPerHost same as http.Transport MaxConnsPerHost. Default is no limit. MaxConnsPerHost int // RequestTimeout same as http.Client Timeout // Deprecated: use ReadTimeout or WriteTimeout instead RequestTimeout time.Duration // DialTimeout same as net.Dialer Timeout DialTimeout time.Duration // KeepAlive same as net.Dialer KeepAlive KeepAlive time.Duration // IdleConnTimeout same as http.Transport IdleConnTimeout IdleConnTimeout time.Duration // TLSHandshakeTimeout same as http.Transport TLSHandshakeTimeout TLSHandshakeTimeout time.Duration // ResponseHeaderTimeout same as http.Transport ResponseHeaderTimeout ResponseHeaderTimeout time.Duration // ExpectContinueTimeout same as http.Transport ExpectContinueTimeout ExpectContinueTimeout time.Duration // ReadTimeout see net.Conn SetReadDeadline ReadTimeout time.Duration // WriteTimeout set net.Conn SetWriteDeadline WriteTimeout time.Duration // InsecureSkipVerify set tls.Config InsecureSkipVerify InsecureSkipVerify bool // DNSCacheTime Set Dns Cache Time. DNSCacheTime time.Duration // Proxy Set http proxy for http client. Proxy *Proxy // When HighLatencyLogThreshold is greater than 0, it indicates the activation of high-latency logging, unit: KB. HighLatencyLogThreshold *int }
func DefaultTransportConfig ¶
func DefaultTransportConfig() TransportConfig
type UnexpectedStatusCodeError ¶
type UnexpectedStatusCodeError struct { StatusCode int `json:"StatusCode,omitempty"` ExpectedCodes []int `json:"ExpectedCodes,omitempty"` RequestID string `json:"RequestId,omitempty"` // contains filtered or unexported fields }
func NewUnexpectedStatusCodeError ¶
func NewUnexpectedStatusCodeError(statusCode int, expectedCode int, expectedCodes ...int) *UnexpectedStatusCodeError
func (*UnexpectedStatusCodeError) Error ¶
func (us *UnexpectedStatusCodeError) Error() string
func (*UnexpectedStatusCodeError) GoString ¶
func (us *UnexpectedStatusCodeError) GoString() string
func (*UnexpectedStatusCodeError) WithEC ¶ added in v2.7.2
func (us *UnexpectedStatusCodeError) WithEC(Ec string) *UnexpectedStatusCodeError
func (*UnexpectedStatusCodeError) WithRequestBody ¶ added in v2.6.0
func (us *UnexpectedStatusCodeError) WithRequestBody(res *Response) *UnexpectedStatusCodeError
func (*UnexpectedStatusCodeError) WithRequestID ¶
func (us *UnexpectedStatusCodeError) WithRequestID(requestID string) *UnexpectedStatusCodeError
type UploadCommonPrefix ¶
type UploadCommonPrefix struct {
Prefix string `json:"Prefix"`
}
type UploadEvent ¶
type UploadEvent struct { Type enum.UploadEventType Err error // failed, aborted 事件发生时不为空 Bucket string Key string UploadID *string CheckpointFile *string // 断点续传文件全路径 // upload part 相关事件发生时有值 UploadPartInfo *UploadPartInfo }
type UploadEventListener ¶
type UploadEventListener interface {
EventChange(event *UploadEvent)
}
type UploadFileInput ¶
type UploadFileInput struct { CreateMultipartUploadV2Input FilePath string PartSize int64 TaskNum int EnableCheckpoint bool CheckpointFile string TrafficLimit int64 `location:"header" locationName:"X-Tos-Traffic-Limit"` DataTransferListener DataTransferListener UploadEventListener UploadEventListener RateLimiter RateLimiter // cancelHook 支持取消断点续传任务 CancelHook CancelHook }
type UploadFileOutput ¶
type UploadInfo ¶
type UploadPartBasicInput ¶
type UploadPartBasicInput struct { Bucket string Key string UploadID string `location:"query" locationName:"uploadId"` PartNumber int `location:"query" locationName:"partNumber"` ContentMD5 string `location:"header" locationName:"Content-MD5"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` ServerSideEncryption string `location:"header" locationName:"X-Tos-Server-Side-Encryption"` ServerSideEncryptionKeyID string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Kms-Key-Id"` TrafficLimit int64 `location:"header" locationName:"X-Tos-Traffic-Limit"` DataTransferListener DataTransferListener RateLimiter RateLimiter }
type UploadPartCopyInput ¶
type UploadPartCopyInput struct { UploadID string `json:"UploadId,omitempty"` DestinationKey string `json:"DestinationKey,omitempty"` SourceBucket string `json:"SourceBucket,omitempty"` SourceKey string `json:"SourceKey,omitempty"` SourceVersionID string `json:"SourceVersionId,omitempty"` // optional StartOffset *int64 `json:"StartOffset,omitempty"` // optional PartSize *int64 `json:"PartSize,omitempty"` // optional PartNumber int `json:"PartNumber,omitempty"` }
type UploadPartCopyOutput ¶
type UploadPartCopyV2Input ¶
type UploadPartCopyV2Input struct { Bucket string Key string UploadID string `location:"query" locationName:"uploadId"` PartNumber int `location:"query" locationName:"partNumber"` SrcBucket string SrcKey string SrcVersionID string `location:"query" locationName:"versionId"` CopySourceRangeStart int64 CopySourceRangeEnd int64 CopySourceRange string CopySourceIfMatch string `location:"header" locationName:"X-Tos-Copy-Source-If-Match"` CopySourceIfModifiedSince time.Time `location:"header" locationName:"X-Tos-Copy-Source-If-Modified-Since"` CopySourceIfNoneMatch string `location:"header" locationName:"X-Tos-Copy-Source-If-None-Match"` CopySourceIfUnmodifiedSince time.Time `location:"header" locationName:"X-Tos-Copy-Source-If-Unmodified-Since"` CopySourceSSECAlgorithm string `location:"header" locationName:"X-Tos-Copy-Source-Server-Side-Encryption-Customer-Algorithm"` CopySourceSSECKey string `location:"header" locationName:"X-Tos-Copy-Source-Server-Side-Encryption-Customer-Key"` CopySourceSSECKeyMD5 string `location:"header" locationName:"X-Tos-Copy-Source-Server-Side-Encryption-Customer-Key-MD5"` SSECKey string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key"` SSECKeyMD5 string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Key-MD5"` SSECAlgorithm string `location:"header" locationName:"X-Tos-Server-Side-Encryption-Customer-Algorithm"` TrafficLimit int64 `location:"header" locationName:"X-Tos-Traffic-Limit"` }
type UploadPartCopyV2Output ¶
type UploadPartFromFileInput ¶
type UploadPartFromFileInput struct { UploadPartBasicInput FilePath string Offset uint64 // 当前分段在文件中的起始位置 PartSize int64 // 当前分段长度,该字段等同于 Content-Length 头域 }
type UploadPartFromFileOutput ¶
type UploadPartFromFileOutput struct {
UploadPartV2Output
}
type UploadPartInfo ¶
type UploadPartInfo struct { PartNumber int PartSize int64 Offset int64 // upload part succeed 事件发生时有值 ETag *string HashCrc64ecma *uint64 }
UploadPartInfo is returned when UploadEvent occur
type UploadPartInput ¶
type UploadPartOutput ¶
type UploadPartOutput struct { RequestInfo `json:"-"` PartNumber int `json:"PartNumber,omitempty"` ETag string `json:"ETag,omitempty"` SSECustomerAlgorithm string `json:"SSECustomerAlgorithm,omitempty"` SSECustomerKeyMD5 string `json:"SSECustomerKeyMD5,omitempty"` }
type UploadPartV2Input ¶
type UploadPartV2Input struct { UploadPartBasicInput Content io.Reader ContentLength int64 `location:"header" locationName:"Content-Length"` }
type UploadPartV2Output ¶
type UploadedPart ¶
type UploadedPartV2 ¶
type WithoutSecretKeyCredentials ¶
type WithoutSecretKeyCredentials struct {
// contains filtered or unexported fields
}
WithoutSecretKeyCredentials Credentials with static access-key and no secret-key
If you don't want to use secret-key directly, but use signed-key, you can use it as:
signer := tos.NewSignV4(tos.NewWithoutSecretKeyCredentials(accessKey), region) signer.WithSigningKey(func(*SigningKeyInfo) []byte { return signingKey}) client, err := tos.NewClient(endpoint, tos.WithSigner(signer)) // do something more
And you can use tos.WithPerRequestSigner set the 'Signer' for each request.
func NewWithoutSecretKeyCredentials ¶
func NewWithoutSecretKeyCredentials(accessKeyID string) *WithoutSecretKeyCredentials
func (*WithoutSecretKeyCredentials) Credential ¶
func (sc *WithoutSecretKeyCredentials) Credential() Credential
func (*WithoutSecretKeyCredentials) WithSecurityToken ¶
func (sc *WithoutSecretKeyCredentials) WithSecurityToken(securityToken string)
WithSecurityToken set security-token
Source Files ¶
- acl.go
- base_client.go
- bucket.go
- bucket_tag.go
- check.go
- checksum.go
- client.go
- config.go
- consts.go
- copy.go
- cors.go
- crc.go
- credential.go
- custom_domain.go
- dns_cache.go
- download_file.go
- encryption.go
- error.go
- fetch.go
- http_trace.go
- lifecycle.go
- logger.go
- metadata.go
- mime.go
- mirror_back.go
- multipart.go
- notification.go
- object.go
- options.go
- parse_output.go
- policy.go
- proxy.go
- rate_limiter.go
- realtime_log.go
- rename.go
- replication.go
- request.go
- resumable_copy.go
- sign_v4.go
- tagging.go
- transport.go
- type.go
- type_internal.go
- upload_file.go
- util.go
- versioning.go
- website.go