Documentation
¶
Index ¶
- Constants
- func CRC64Combine(crc1 uint64, crc2 uint64, len2 uint64) uint64
- func DirExists(dir string) bool
- func EmptyFile(filename string) bool
- func FileExists(filename string) bool
- func GetReaderLen(r io.Reader) int64
- func NewCRC64(init uint64) hash.Hash64
- func NewLimitedReadCloser(rc io.ReadCloser, limit int64) io.ReadCloser
- func NewProgress(pr ProgressFunc, total int64) io.Writer
- func OpReadWriteTimeout(value time.Duration) func(*Options)
- func ParseContentRange(s string) (from int64, to int64, total int64, err error)
- func ParseOffsetAndSizeFromHeaders(headers http.Header) (offset, size int64)
- func PresignExpiration(value time.Time) func(*PresignOptions)
- func PresignExpires(value time.Duration) func(*PresignOptions)
- func Ptr[T any](v T) *T
- func SliceOfPtrs[T any](vv ...T) []*T
- func TeeReadNopCloser(reader io.Reader, writers ...io.Writer) io.ReadCloser
- func ToBool(p *bool) (v bool)
- func ToDuration(p *time.Duration) (v time.Duration)
- func ToInt(p *int) (v int)
- func ToInt64(p *int64) (v int64)
- func ToLogLevel(s string) int
- func ToString(p *string) (v string)
- func ToTime(p *time.Time) (v time.Time)
- func TypeByExtension(filePath string) string
- func Version() string
- type AbortMultipartUploadRequest
- type AbortMultipartUploadResult
- type AppendFileAPIClient
- type AppendObjectRequest
- type AppendObjectResult
- type AppendOnlyFile
- type AppendOptions
- type AsyncProcessObjectRequest
- type AsyncProcessObjectResult
- type AsyncRangeReader
- type AuthMethodType
- type BucketACLType
- type BucketInfo
- type BucketPolicy
- type BucketProperties
- type BwTokenBucket
- type BwTokenBuckets
- type CSVSelectInput
- type CSVSelectOutput
- type CanceledError
- type Client
- func (c *Client) AbortMultipartUpload(ctx context.Context, request *AbortMultipartUploadRequest, ...) (*AbortMultipartUploadResult, error)
- func (c *Client) AppendFile(ctx context.Context, bucket string, key string, optFns ...func(*AppendOptions)) (*AppendOnlyFile, error)
- func (c *Client) AppendObject(ctx context.Context, request *AppendObjectRequest, optFns ...func(*Options)) (*AppendObjectResult, error)
- func (c *Client) AsyncProcessObject(ctx context.Context, request *AsyncProcessObjectRequest, ...) (*AsyncProcessObjectResult, error)
- func (c *Client) CompleteMultipartUpload(ctx context.Context, request *CompleteMultipartUploadRequest, ...) (*CompleteMultipartUploadResult, error)
- func (c *Client) CopyObject(ctx context.Context, request *CopyObjectRequest, optFns ...func(*Options)) (*CopyObjectResult, error)
- func (c *Client) CreateSelectObjectMeta(ctx context.Context, request *CreateSelectObjectMetaRequest, ...) (*CreateSelectObjectMetaResult, error)
- func (c *Client) DeleteBucket(ctx context.Context, request *DeleteBucketRequest, optFns ...func(*Options)) (*DeleteBucketResult, error)
- func (c *Client) DeleteMultipleObjects(ctx context.Context, request *DeleteMultipleObjectsRequest, ...) (*DeleteMultipleObjectsResult, error)
- func (c *Client) DeleteObject(ctx context.Context, request *DeleteObjectRequest, optFns ...func(*Options)) (*DeleteObjectResult, error)
- func (c *Client) DeleteObjectTagging(ctx context.Context, request *DeleteObjectTaggingRequest, ...) (*DeleteObjectTaggingResult, error)
- func (c *Client) GetBucketAcl(ctx context.Context, request *GetBucketAclRequest, optFns ...func(*Options)) (*GetBucketAclResult, error)
- func (c *Client) GetBucketInfo(ctx context.Context, request *GetBucketInfoRequest, optFns ...func(*Options)) (*GetBucketInfoResult, error)
- func (c *Client) GetBucketLocation(ctx context.Context, request *GetBucketLocationRequest, ...) (*GetBucketLocationResult, error)
- func (c *Client) GetBucketRequestPayment(ctx context.Context, request *GetBucketRequestPaymentRequest, ...) (*GetBucketRequestPaymentResult, error)
- func (c *Client) GetBucketStat(ctx context.Context, request *GetBucketStatRequest, optFns ...func(*Options)) (*GetBucketStatResult, error)
- func (c *Client) GetBucketVersioning(ctx context.Context, request *GetBucketVersioningRequest, ...) (*GetBucketVersioningResult, error)
- func (c *Client) GetObject(ctx context.Context, request *GetObjectRequest, optFns ...func(*Options)) (*GetObjectResult, error)
- func (c *Client) GetObjectAcl(ctx context.Context, request *GetObjectAclRequest, optFns ...func(*Options)) (*GetObjectAclResult, error)
- func (c *Client) GetObjectMeta(ctx context.Context, request *GetObjectMetaRequest, optFns ...func(*Options)) (*GetObjectMetaResult, error)
- func (c *Client) GetObjectTagging(ctx context.Context, request *GetObjectTaggingRequest, ...) (*GetObjectTaggingResult, error)
- func (c *Client) GetObjectToFile(ctx context.Context, request *GetObjectRequest, filePath string, ...) (*GetObjectResult, error)
- func (c *Client) GetSymlink(ctx context.Context, request *GetSymlinkRequest, optFns ...func(*Options)) (*GetSymlinkResult, error)
- func (c *Client) HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error)
- func (c *Client) InitiateMultipartUpload(ctx context.Context, request *InitiateMultipartUploadRequest, ...) (*InitiateMultipartUploadResult, error)
- func (c *Client) InvokeOperation(ctx context.Context, input *OperationInput, optFns ...func(*Options)) (*OperationOutput, error)
- func (c *Client) IsBucketExist(ctx context.Context, bucket string, optFns ...func(*Options)) (bool, error)
- func (c *Client) IsObjectExist(ctx context.Context, bucket string, key string, ...) (bool, error)
- func (c *Client) ListBuckets(ctx context.Context, request *ListBucketsRequest, optFns ...func(*Options)) (*ListBucketsResult, error)
- func (c *Client) ListMultipartUploads(ctx context.Context, request *ListMultipartUploadsRequest, ...) (*ListMultipartUploadsResult, error)
- func (c *Client) ListObjectVersions(ctx context.Context, request *ListObjectVersionsRequest, ...) (*ListObjectVersionsResult, error)
- func (c *Client) ListObjects(ctx context.Context, request *ListObjectsRequest, optFns ...func(*Options)) (*ListObjectsResult, error)
- func (c *Client) ListObjectsV2(ctx context.Context, request *ListObjectsV2Request, optFns ...func(*Options)) (*ListObjectsV2Result, error)
- func (c *Client) ListParts(ctx context.Context, request *ListPartsRequest, optFns ...func(*Options)) (*ListPartsResult, error)
- func (c *Client) NewCopier(optFns ...func(*CopierOptions)) *Copier
- func (c *Client) NewDownloader(optFns ...func(*DownloaderOptions)) *Downloader
- func (c *Client) NewListBucketsPaginator(request *ListBucketsRequest, optFns ...func(*PaginatorOptions)) *ListBucketsPaginator
- func (c *Client) NewListMultipartUploadsPaginator(request *ListMultipartUploadsRequest, optFns ...func(*PaginatorOptions)) *ListMultipartUploadsPaginator
- func (c *Client) NewListObjectVersionsPaginator(request *ListObjectVersionsRequest, optFns ...func(*PaginatorOptions)) *ListObjectVersionsPaginator
- func (c *Client) NewListObjectsPaginator(request *ListObjectsRequest, optFns ...func(*PaginatorOptions)) *ListObjectsPaginator
- func (c *Client) NewListObjectsV2Paginator(request *ListObjectsV2Request, optFns ...func(*PaginatorOptions)) *ListObjectsV2Paginator
- func (c *Client) NewListPartsPaginator(request *ListPartsRequest, optFns ...func(*PaginatorOptions)) *ListPartsPaginator
- func (c *Client) NewUploader(optFns ...func(*UploaderOptions)) *Uploader
- func (c *Client) OpenFile(ctx context.Context, bucket string, key string, optFns ...func(*OpenOptions)) (*ReadOnlyFile, error)
- func (c *Client) Presign(ctx context.Context, request any, optFns ...func(*PresignOptions)) (*PresignResult, error)
- func (c *Client) ProcessObject(ctx context.Context, request *ProcessObjectRequest, optFns ...func(*Options)) (*ProcessObjectResult, error)
- func (c *Client) PutBucket(ctx context.Context, request *PutBucketRequest, optFns ...func(*Options)) (*PutBucketResult, error)
- func (c *Client) PutBucketAcl(ctx context.Context, request *PutBucketAclRequest, optFns ...func(*Options)) (*PutBucketAclResult, error)
- func (c *Client) PutBucketRequestPayment(ctx context.Context, request *PutBucketRequestPaymentRequest, ...) (*PutBucketRequestPaymentResult, error)
- func (c *Client) PutBucketVersioning(ctx context.Context, request *PutBucketVersioningRequest, ...) (*PutBucketVersioningResult, error)
- func (c *Client) PutObject(ctx context.Context, request *PutObjectRequest, optFns ...func(*Options)) (*PutObjectResult, error)
- func (c *Client) PutObjectAcl(ctx context.Context, request *PutObjectAclRequest, optFns ...func(*Options)) (*PutObjectAclResult, error)
- func (c *Client) PutObjectFromFile(ctx context.Context, request *PutObjectRequest, filePath string, ...) (*PutObjectResult, error)
- func (c *Client) PutObjectTagging(ctx context.Context, request *PutObjectTaggingRequest, ...) (*PutObjectTaggingResult, error)
- func (c *Client) PutSymlink(ctx context.Context, request *PutSymlinkRequest, optFns ...func(*Options)) (*PutSymlinkResult, error)
- func (c *Client) RestoreObject(ctx context.Context, request *RestoreObjectRequest, optFns ...func(*Options)) (*RestoreObjectResult, error)
- func (c *Client) SelectObject(ctx context.Context, request *SelectObjectRequest, optFns ...func(*Options)) (*SelectObjectResult, error)
- func (c *Client) UploadPart(ctx context.Context, request *UploadPartRequest, optFns ...func(*Options)) (*UploadPartResult, error)
- func (c *Client) UploadPartCopy(ctx context.Context, request *UploadPartCopyRequest, optFns ...func(*Options)) (*UploadPartCopyResult, error)
- type ClientError
- type CommonPrefix
- type CompleteMultipartUpload
- type CompleteMultipartUploadRequest
- type CompleteMultipartUploadResult
- type Config
- func (c Config) Copy() Config
- func (c *Config) WithAdditionalHeaders(value []string) *Config
- func (c *Config) WithConnectTimeout(value time.Duration) *Config
- func (c *Config) WithCredentialsProvider(provider credentials.CredentialsProvider) *Config
- func (c *Config) WithDisableDownloadCRC64Check(value bool) *Config
- func (c *Config) WithDisableSSL(value bool) *Config
- func (c *Config) WithDisableUploadCRC64Check(value bool) *Config
- func (c *Config) WithDownloadBandwidthlimit(value int64) *Config
- func (c *Config) WithEnabledRedirect(value bool) *Config
- func (c *Config) WithEndpoint(endpoint string) *Config
- func (c *Config) WithHttpClient(client *http.Client) *Config
- func (c *Config) WithInsecureSkipVerify(value bool) *Config
- func (c *Config) WithLogLevel(level int) *Config
- func (c *Config) WithLogPrinter(printer LogPrinter) *Config
- func (c *Config) WithProxyFromEnvironment(value bool) *Config
- func (c *Config) WithProxyHost(value string) *Config
- func (c *Config) WithReadWriteTimeout(value time.Duration) *Config
- func (c *Config) WithRegion(region string) *Config
- func (c *Config) WithRetryMaxAttempts(value int) *Config
- func (c *Config) WithRetryer(retryer retry.Retryer) *Config
- func (c *Config) WithSignatureVersion(value SignatureVersionType) *Config
- func (c *Config) WithUploadBandwidthlimit(value int64) *Config
- func (c *Config) WithUseAccelerateEndpoint(value bool) *Config
- func (c *Config) WithUseCName(enable bool) *Config
- func (c *Config) WithUseDualStackEndpoint(value bool) *Config
- func (c *Config) WithUseInternalEndpoint(value bool) *Config
- func (c *Config) WithUsePathStyle(enable bool) *Config
- func (c *Config) WithUserAgent(value string) *Config
- type Copier
- type CopierOptions
- type CopyAPIClient
- type CopyError
- type CopyObjectRequest
- type CopyObjectResult
- type CopyResult
- type CreateBucketConfiguration
- type CreateSelectObjectMetaRequest
- type CreateSelectObjectMetaResult
- type CsvMetaRequest
- type DataRedundancyType
- type DeleteBucketRequest
- type DeleteBucketResult
- type DeleteMultipleObjectsRequest
- type DeleteMultipleObjectsResult
- type DeleteObject
- type DeleteObjectRequest
- type DeleteObjectResult
- type DeleteObjectTaggingRequest
- type DeleteObjectTaggingResult
- type DeletedInfo
- type DeserializationError
- type DiscardReadCloser
- type DownloadAPIClient
- type DownloadError
- type DownloadResult
- type Downloader
- type DownloaderOptions
- type EncryptionClient
- func (e *EncryptionClient) AbortMultipartUpload(ctx context.Context, request *AbortMultipartUploadRequest, ...) (*AbortMultipartUploadResult, error)
- func (e *EncryptionClient) CompleteMultipartUpload(ctx context.Context, request *CompleteMultipartUploadRequest, ...) (*CompleteMultipartUploadResult, error)
- func (e *EncryptionClient) GetObject(ctx context.Context, request *GetObjectRequest, optFns ...func(*Options)) (*GetObjectResult, error)
- func (e *EncryptionClient) GetObjectMeta(ctx context.Context, request *GetObjectMetaRequest, optFns ...func(*Options)) (*GetObjectMetaResult, error)
- func (e *EncryptionClient) HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error)
- func (e *EncryptionClient) InitiateMultipartUpload(ctx context.Context, request *InitiateMultipartUploadRequest, ...) (*InitiateMultipartUploadResult, error)
- func (e *EncryptionClient) ListParts(ctx context.Context, request *ListPartsRequest, optFns ...func(*Options)) (*ListPartsResult, error)
- func (c *EncryptionClient) NewDownloader(optFns ...func(*DownloaderOptions)) *Downloader
- func (c *EncryptionClient) NewUploader(optFns ...func(*UploaderOptions)) *Uploader
- func (c *EncryptionClient) OpenFile(ctx context.Context, bucket string, key string, optFns ...func(*OpenOptions)) (*ReadOnlyFile, error)
- func (e *EncryptionClient) PutObject(ctx context.Context, request *PutObjectRequest, optFns ...func(*Options)) (*PutObjectResult, error)
- func (e *EncryptionClient) Unwrap() *Client
- func (e *EncryptionClient) UploadPart(ctx context.Context, request *UploadPartRequest, optFns ...func(*Options)) (*UploadPartResult, error)
- type EncryptionClientOptions
- type EncryptionMultiPartContext
- type EndpointType
- type FeatureFlagsType
- type GetBucketAclRequest
- type GetBucketAclResult
- type GetBucketInfoRequest
- type GetBucketInfoResult
- type GetBucketLocationRequest
- type GetBucketLocationResult
- type GetBucketRequestPaymentRequest
- type GetBucketRequestPaymentResult
- type GetBucketStatRequest
- type GetBucketStatResult
- type GetBucketVersioningRequest
- type GetBucketVersioningResult
- type GetObjectAclRequest
- type GetObjectAclResult
- type GetObjectMetaRequest
- type GetObjectMetaResult
- type GetObjectRequest
- type GetObjectResult
- type GetObjectTaggingRequest
- type GetObjectTaggingResult
- type GetSymlinkRequest
- type GetSymlinkResult
- type HTTPClient
- type HTTPContentRange
- type HTTPRange
- type HeadObjectRequest
- type HeadObjectResult
- type InitiateMultipartUploadRequest
- type InitiateMultipartUploadResult
- type InputSerialization
- type InputSerializationCSV
- type InputSerializationJSON
- type InputSerializationSelect
- type InvalidParamError
- type IsObjectExistOptions
- type JSONSelectInput
- type JSONSelectOutput
- type JsonMetaRequest
- type LimitedReadCloser
- type ListBucketsPaginator
- type ListBucketsRequest
- type ListBucketsResult
- type ListMultipartUploadsPaginator
- type ListMultipartUploadsRequest
- type ListMultipartUploadsResult
- type ListObjectVersionsPaginator
- type ListObjectVersionsRequest
- type ListObjectVersionsResult
- type ListObjectsPaginator
- type ListObjectsRequest
- type ListObjectsResult
- type ListObjectsV2Paginator
- type ListObjectsV2Request
- type ListObjectsV2Result
- type ListPartsAPIClient
- type ListPartsPaginator
- type ListPartsRequest
- type ListPartsResult
- type LogPrinter
- type LogPrinterFunc
- type Logger
- type MultiBytesReader
- type ObjectACLType
- type ObjectDeleteMarkerProperties
- type ObjectMixProperties
- type ObjectProperties
- type ObjectVersionProperties
- type OpenFileAPIClient
- type OpenOptions
- type OperationError
- type OperationInput
- type OperationMetadata
- type OperationOutput
- type Options
- type OutputSerializationSelect
- type Owner
- type PaginatorOptions
- type Part
- type PayerType
- type PresignOptions
- type PresignResult
- type ProcessObjectRequest
- type ProcessObjectResult
- type ProgressFunc
- type PutBucketAclRequest
- type PutBucketAclResult
- type PutBucketRequest
- type PutBucketRequestPaymentRequest
- type PutBucketRequestPaymentResult
- type PutBucketResult
- type PutBucketVersioningRequest
- type PutBucketVersioningResult
- type PutObjectAclRequest
- type PutObjectAclResult
- type PutObjectRequest
- type PutObjectResult
- type PutObjectTaggingRequest
- type PutObjectTaggingResult
- type PutSymlinkRequest
- type PutSymlinkResult
- type RangeReader
- type ReadFlagInfo
- type ReadOnlyFile
- type ReadSeekerNopClose
- func (r ReadSeekerNopClose) Close() error
- func (r ReadSeekerNopClose) GetLen() (int64, error)
- func (r ReadSeekerNopClose) HasLen() (int, bool)
- func (r ReadSeekerNopClose) IsSeeker() bool
- func (r ReadSeekerNopClose) Read(p []byte) (int, error)
- func (r ReadSeekerNopClose) Seek(offset int64, whence int) (int64, error)
- type ReaderRangeGetFn
- type ReaderRangeGetOutput
- type ReaderWrapper
- type RequestBodyTracker
- type RequestCommon
- type RequestCommonInterface
- type RequestPaymentConfiguration
- type RestoreObjectRequest
- type RestoreObjectResult
- type RestoreRequest
- type ResultCommon
- type ResultCommonInterface
- type SSERule
- type SelectObjectRequest
- type SelectObjectResult
- type SelectOptions
- type SelectRequest
- type SerializationError
- type ServiceError
- type SignatureVersionType
- type StorageClassType
- type Tag
- type TagSet
- type Tagging
- type Upload
- type UploadAPIClient
- type UploadError
- type UploadPart
- type UploadPartCopyRequest
- type UploadPartCopyResult
- type UploadPartRequest
- type UploadPartResult
- type UploadParts
- type UploadResult
- type Uploader
- type UploaderOptions
- type UrlStyleType
- type VersioningConfiguration
- type VersioningStatusType
- type XmlChildren
- type XmlDecoderLite
- type XmlNode
Constants ¶
const ( DataFrameType = 8388609 ContinuousFrameType = 8388612 EndFrameType = 8388613 MetaEndFrameCSVType = 8388614 MetaEndFrameJSONType = 8388615 )
FrameType
const ( MaxUploadParts int32 = 10000 // Max part size, 5GB, For UploadPart MaxPartSize int64 = 5 * 1024 * 1024 * 1024 // Min part size, 100KB, For UploadPart MinPartSize int64 = 100 * 1024 // Default part size, 6M DefaultPartSize int64 = 6 * 1024 * 1024 // Default part size for uploader uploads data DefaultUploadPartSize = DefaultPartSize // Default part size for downloader downloads object DefaultDownloadPartSize = DefaultPartSize // Default part size for copier copys object, 64M DefaultCopyPartSize int64 = 64 * 1024 * 1024 // Default parallel DefaultParallel = 3 // Default parallel for uploader uploads data DefaultUploadParallel = DefaultParallel // Default parallel for downloader downloads object DefaultDownloadParallel = DefaultParallel // Default parallel for copier copys object DefaultCopyParallel = DefaultParallel // Default prefetch threshold to swith to async read in ReadOnlyFile DefaultPrefetchThreshold int64 = 20 * 1024 * 1024 // Default prefetch number for async read in ReadOnlyFile DefaultPrefetchNum = DefaultParallel // Default prefetch chunk size for async read in ReadOnlyFile DefaultPrefetchChunkSize = DefaultPartSize // Default threshold to use muitipart copy in Copier, 256M DefaultCopyThreshold int64 = 200 * 1024 * 1024 // File permission FilePermMode = os.FileMode(0664) // Temp file suffix TempFileSuffix = ".temp" // Checkpoint file suffix for Downloader CheckpointFileSuffixDownloader = ".dcp" // Checkpoint file suffix for Uploader CheckpointFileSuffixUploader = ".ucp" // Checkpoint file Magic CheckpointMagic = "92611BED-89E2-46B6-89E5-72F273D4B0A3" // Product for signing DefaultProduct = "oss" // The URL's scheme, default is https DefaultEndpointScheme = "https" // Default signature version is v4 DefaultSignatureVersion = SignatureVersionV4 )
const ( HeaderOssPrefix string = "X-Oss-" HeaderOssMetaPrefix = "X-Oss-Meta-" HeaderOssACL = "X-Oss-Acl" HeaderOssObjectACL = "X-Oss-Object-Acl" HeaderOssObjectType = "X-Oss-Object-Type" HeaderOssSecurityToken = "X-Oss-Security-Token" HeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption" HeaderOssServerSideEncryptionKeyID = "X-Oss-Server-Side-Encryption-Key-Id" HeaderOssServerSideDataEncryption = "X-Oss-Server-Side-Data-Encryption" HeaderOssSSECAlgorithm = "X-Oss-Server-Side-Encryption-Customer-Algorithm" HeaderOssSSECKey = "X-Oss-Server-Side-Encryption-Customer-Key" HeaderOssSSECKeyMd5 = "X-Oss-Server-Side-Encryption-Customer-Key-MD5" HeaderOssCopySource = "X-Oss-Copy-Source" HeaderOssCopySourceRange = "X-Oss-Copy-Source-Range" HeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match" HeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match" HeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since" HeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since" HeaderOssMetadataDirective = "X-Oss-Metadata-Directive" HeaderOssNextAppendPosition = "X-Oss-Next-Append-Position" HeaderOssRequestID = "X-Oss-Request-Id" HeaderOssCRC64 = "X-Oss-Hash-Crc64ecma" HeaderOssSymlinkTarget = "X-Oss-Symlink-Target" HeaderOssStorageClass = "X-Oss-Storage-Class" HeaderOssCallback = "X-Oss-Callback" HeaderOssCallbackVar = "X-Oss-Callback-Var" HeaderOssRequester = "X-Oss-Request-Payer" HeaderOssTagging = "X-Oss-Tagging" HeaderOssTaggingDirective = "X-Oss-Tagging-Directive" HeaderOssTrafficLimit = "X-Oss-Traffic-Limit" HeaderOssForbidOverWrite = "X-Oss-Forbid-Overwrite" HeaderOssRangeBehavior = "X-Oss-Range-Behavior" HeaderOssAllowSameActionOverLap = "X-Oss-Allow-Same-Action-Overlap" HeaderOssDate = "X-Oss-Date" HeaderOssContentSha256 = "X-Oss-Content-Sha256" HeaderOssEC = "X-Oss-Ec" HeaderOssERR = "X-Oss-Err" )
OSS headers
const ( OssClientSideEncryptionKey string = "X-Oss-Meta-Client-Side-Encryption-Key" OssClientSideEncryptionStart = "X-Oss-Meta-Client-Side-Encryption-Start" OssClientSideEncryptionCekAlg = "X-Oss-Meta-Client-Side-Encryption-Cek-Alg" OssClientSideEncryptionWrapAlg = "X-Oss-Meta-Client-Side-Encryption-Wrap-Alg" OssClientSideEncryptionMatDesc = "X-Oss-Meta-Client-Side-Encryption-Matdesc" OssClientSideEncryptionUnencryptedContentLength = "X-Oss-Meta-Client-Side-Encryption-Unencrypted-Content-Length" OssClientSideEncryptionUnencryptedContentMD5 = "X-Oss-Meta-Client-Side-Encryption-Unencrypted-Content-Md5" OssClientSideEncryptionDataSize = "X-Oss-Meta-Client-Side-Encryption-Data-Size" OssClientSideEncryptionPartSize = "X-Oss-Meta-Client-Side-Encryption-Part-Size" )
OSS headers for client sider encryption
const ( HTTPHeaderAcceptEncoding string = "Accept-Encoding" HTTPHeaderAuthorization = "Authorization" HTTPHeaderCacheControl = "Cache-Control" HTTPHeaderContentDisposition = "Content-Disposition" HTTPHeaderContentEncoding = "Content-Encoding" HTTPHeaderContentLength = "Content-Length" HTTPHeaderContentMD5 = "Content-MD5" HTTPHeaderContentType = "Content-Type" HTTPHeaderContentLanguage = "Content-Language" HTTPHeaderContentRange = "Content-Range" HTTPHeaderDate = "Date" HTTPHeaderETag = "ETag" HTTPHeaderExpires = "Expires" HTTPHeaderHost = "Host" HTTPHeaderLastModified = "Last-Modified" HTTPHeaderRange = "Range" HTTPHeaderLocation = "Location" HTTPHeaderUserAgent = "User-Agent" HTTPHeaderIfModifiedSince = "If-Modified-Since" HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since" HTTPHeaderIfMatch = "If-Match" HTTPHeaderIfNoneMatch = "If-None-Match" )
HTTP headers
const ( OpMetaKeyResponsHandler string = "opm-response-handler" OpMetaKeyRequestBodyTracker string = "opm-request-body-tracker" )
OperationMetadata Keys
const ( BwTokenBucketSlotRx int = iota BwTokenBucketSlotTx BwTokenBucketSlots )
const ( LogOff = iota LogError LogWarn LogInfo LogDebug )
Define the level of the output log
const (
AsyncReadeBufferSize = 1024 * 1024
)
const (
EncryptionUaSuffix string = "OssEncryptionClient"
)
EncryptionUaSuffix user agent tag for client encryption
const (
SdkName = "alibabacloud-go-sdk-v2"
)
Variables ¶
This section is empty.
Functions ¶
func CRC64Combine ¶
CRC64Combine combines CRC64
func FileExists ¶
FileExists returns whether the given file exists or not
func GetReaderLen ¶
func NewCRC64 ¶
NewCRC64 NewCRC creates a new hash.Hash64 computing the CRC64 checksum using the polynomial represented by the Table.
func NewLimitedReadCloser ¶
func NewLimitedReadCloser(rc io.ReadCloser, limit int64) io.ReadCloser
func NewProgress ¶
func NewProgress(pr ProgressFunc, total int64) io.Writer
NewProgress NewRequestProgress creates a tracker with progress reporting
func OpReadWriteTimeout ¶
func ParseContentRange ¶
ParseRange parses a ContentRange from a ContentRange: header. It only accepts bytes 22-33/42 and bytes 22-33/* format.
func PresignExpiration ¶
func PresignExpiration(value time.Time) func(*PresignOptions)
func PresignExpires ¶
func PresignExpires(value time.Duration) func(*PresignOptions)
func SliceOfPtrs ¶
func SliceOfPtrs[T any](vv ...T) []*T
SliceOfPtrs returns a slice of *T from the specified values.
func TeeReadNopCloser ¶
TeeReadNopCloser returns a Reader that writes to w what it reads from r. All reads from r performed through it are matched with corresponding writes to w. There is no internal buffering - the write must complete before the read completes. Any error encountered while writing is reported as a read error.
func ToBool ¶
ToBool returns bool value if the pointer is not nil. Returns a bool zero value if the pointer is nil.
func ToDuration ¶
ToDuration returns time.Duration value if the pointer is not nil. Returns a time.Duration zero value if the pointer is nil.
func ToInt ¶
ToInt returns int value if the pointer is not nil. Returns a int zero value if the pointer is nil.
func ToInt64 ¶
ToInt64 returns int value if the pointer is not nil. Returns a int64 zero value if the pointer is nil.
func ToLogLevel ¶
func ToString ¶
ToString returns bool value if the pointer is not nil. Returns a string zero value if the pointer is nil.
func ToTime ¶
ToTime returns time.Time value if the pointer is not nil. Returns a time.Time zero value if the pointer is nil.
func TypeByExtension ¶
TypeByExtension returns the MIME type associated with the file extension ext. gets the file's MIME type for HTTP header Content-Type
Types ¶
type AbortMultipartUploadRequest ¶
type AbortMultipartUploadRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The name of the object. Key *string `input:"path,key,required"` // The ID of the multipart upload task. UploadId *string `input:"query,uploadId,required"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type AbortMultipartUploadResult ¶
type AbortMultipartUploadResult struct {
ResultCommon
}
type AppendFileAPIClient ¶
type AppendFileAPIClient interface { HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error) AppendObject(ctx context.Context, request *AppendObjectRequest, optFns ...func(*Options)) (*AppendObjectResult, error) }
type AppendObjectRequest ¶
type AppendObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The position from which the AppendObject operation starts. // Each time an AppendObject operation succeeds, the x-oss-next-append-position header is included in // the response to specify the position from which the next AppendObject operation starts. Position *int64 `input:"query,position,required"` // The caching behavior of the web page when the object is downloaded. CacheControl *string `input:"header,Cache-Control"` // The method that is used to access the object. ContentDisposition *string `input:"header,Content-Disposition"` // The method that is used to encode the object. ContentEncoding *string `input:"header,Content-Encoding"` // The size of the data in the HTTP message body. Unit: bytes. ContentLength *int64 `input:"header,Content-Length"` // The MD5 hash of the object that you want to upload. ContentMD5 *string `input:"header,Content-MD5"` // The expiration time of the cache in UTC. Expires *string `input:"header,Expires"` // A standard MIME type describing the format of the contents. ContentType *string `input:"header,Content-Type"` // Specifies whether the object that is uploaded by calling the PutObject operation // overwrites an existing object that has the same name. Valid values: true and false ForbidOverwrite *string `input:"header,x-oss-forbid-overwrite"` // The encryption method on the server side when an object is created. // Valid values: AES256 and KMS ServerSideEncryption *string `input:"header,x-oss-server-side-encryption"` //The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). //This header is valid only when the x-oss-server-side-encryption header is set to KMS. ServerSideDataEncryption *string `input:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `input:"header,x-oss-server-side-encryption-key-id"` // The access control list (ACL) of the object. Acl ObjectACLType `input:"header,x-oss-object-acl"` // The storage class of the object. StorageClass StorageClassType `input:"header,x-oss-storage-class"` // The metadata of the object that you want to upload. Metadata map[string]string `input:"header,x-oss-meta-,usermeta"` // The tags that are specified for the object by using a key-value pair. // You can specify multiple tags for an object. Example: TagA=A&TagB=B. Tagging *string `input:"header,x-oss-tagging"` // Specify the speed limit value. The speed limit value ranges from 245760 to 838860800, with a unit of bit/s. TrafficLimit int64 `input:"header,x-oss-traffic-limit"` // Object data. Body io.Reader `input:"body,nop"` // Specify the initial value of CRC64. If not set, the crc check is ignored. InitHashCRC64 *string // Progress callback function ProgressFn ProgressFunc // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type AppendObjectResult ¶
type AppendObjectResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` // The position that must be provided in the next request, which is the current length of the object. NextPosition int64 `output:"header,x-oss-next-append-position"` // The encryption method on the server side when an object is created. // Valid values: AES256 and KMS ServerSideEncryption *string `output:"header,x-oss-server-side-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). // This header is valid only when the x-oss-server-side-encryption header is set to KMS. ServerSideDataEncryption *string `output:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `output:"header,x-oss-server-side-encryption-key-id"` // A map of metadata to store with the object. Metadata map[string]string `output:"header,x-oss-meta-,usermeta"` ResultCommon }
type AppendOnlyFile ¶
type AppendOnlyFile struct {
// contains filtered or unexported fields
}
func NewAppendFile ¶
func NewAppendFile(ctx context.Context, c AppendFileAPIClient, bucket string, key string, optFns ...func(*AppendOptions)) (*AppendOnlyFile, error)
NewAppendFile AppendFile opens or creates the named file for appending. If successful, methods on the returned file can be used for appending.
func (*AppendOnlyFile) Stat ¶
func (f *AppendOnlyFile) Stat() (os.FileInfo, error)
Stat returns the FileInfo structure describing file.
type AppendOptions ¶
type AppendOptions struct { // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string // The parameters when the object is first generated, supports below // CacheControl, ContentEncoding, Expires, ContentType, ContentType, Metadata // SSE's parameters, Acl, StorageClass, Tagging // If the object exists, ignore this parameters CreateParameter *AppendObjectRequest }
type AsyncProcessObjectRequest ¶
type AsyncProcessObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // Image async processing parameters AsyncProcess *string `input:"x-async-oss-process,nop,required"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type AsyncProcessObjectResult ¶
type AsyncProcessObjectResult struct { EventId string `json:"EventId"` RequestId string `json:"RequestId"` TaskId string `json:"TaskId"` ResultCommon }
type AsyncRangeReader ¶
type AsyncRangeReader struct {
// contains filtered or unexported fields
}
func NewAsyncRangeReader ¶
func NewAsyncRangeReader(ctx context.Context, rangeGet ReaderRangeGetFn, httpRange *HTTPRange, etag string, buffers int) (*AsyncRangeReader, error)
NewAsyncRangeReader returns a reader that will asynchronously read from the Reader returued by getter from the given offset into a number of buffers each of size AsyncReadeBufferSize The input can be read from the returned reader. When done use Close to release the buffers and close the supplied input. The etag is used to identify the content of the object. If not set, the first ETag returned value will be used instead.
func (*AsyncRangeReader) Close ¶
func (a *AsyncRangeReader) Close() (err error)
func (*AsyncRangeReader) Offset ¶
func (a *AsyncRangeReader) Offset() int64
type AuthMethodType ¶
type AuthMethodType int
const ( AuthMethodHeader AuthMethodType = iota AuthMethodQuery )
func (AuthMethodType) String ¶
func (f AuthMethodType) String() string
type BucketACLType ¶
type BucketACLType string
BucketACLType The access control list (ACL) of the bucket
const ( // BucketACLPrivate Only the bucket owner can perform read and write operations on objects in the bucket. // Other users cannot access the objects in the bucket. BucketACLPrivate BucketACLType = "private" // BucketACLPublicRead Only the bucket owner can write data to objects in the bucket. // Other users, including anonymous users, can only read objects in the bucket. BucketACLPublicRead BucketACLType = "public-read" // BucketACLPublicReadWrite All users, including anonymous users, can perform read and write operations on the bucket. BucketACLPublicReadWrite BucketACLType = "public-read-write" )
Enum values for BucketACLType
type BucketInfo ¶
type BucketInfo struct { // The name of the bucket. Name *string `xml:"Name"` // Indicates whether access tracking is enabled for the bucket. AccessMonitor *string `xml:"AccessMonitor"` // The region in which the bucket is located. Location *string `xml:"Location"` // The time when the bucket is created. The time is in UTC. CreationDate *time.Time `xml:"CreationDate"` // The public endpoint that is used to access the bucket over the Internet. ExtranetEndpoint *string `xml:"ExtranetEndpoint"` // The internal endpoint that is used to access the bucket from Elastic IntranetEndpoint *string `xml:"IntranetEndpoint"` // The container that stores the access control list (ACL) information about the bucket. ACL *string `xml:"AccessControlList>Grant"` // The disaster recovery type of the bucket. DataRedundancyType *string `xml:"DataRedundancyType"` // The container that stores the information about the bucket owner. Owner *Owner `xml:"Owner"` // The storage class of the bucket. StorageClass *string `xml:"StorageClass"` // The ID of the resource group to which the bucket belongs. ResourceGroupId *string `xml:"ResourceGroupId"` // The container that stores the server-side encryption method. SseRule SSERule `xml:"ServerSideEncryptionRule"` // Indicates whether versioning is enabled for the bucket. Versioning *string `xml:"Versioning"` // Indicates whether transfer acceleration is enabled for the bucket. TransferAcceleration *string `xml:"TransferAcceleration"` // Indicates whether cross-region replication (CRR) is enabled for the bucket. CrossRegionReplication *string `xml:"CrossRegionReplication"` // The container that stores the logs. BucketPolicy BucketPolicy `xml:"BucketPolicy"` }
BucketInfo defines Bucket information
type BucketPolicy ¶
type BucketProperties ¶
type BucketProperties struct { // The name of the bucket. Name *string `xml:"Name"` // The data center in which the bucket is located. Location *string `xml:"Location"` // The time when the bucket was created. Format: yyyy-mm-ddThh:mm:ss.timezone. CreationDate *time.Time `xml:"CreationDate"` // The storage class of the bucket. Valid values: // Standard, IA, Archive, ColdArchive and DeepColdArchive. StorageClass *string `xml:"StorageClass"` // The public endpoint used to access the bucket over the Internet. ExtranetEndpoint *string `xml:"ExtranetEndpoint"` // The internal endpoint that is used to access the bucket from ECS instances // that reside in the same region as the bucket. IntranetEndpoint *string `xml:"IntranetEndpoint"` // The region in which the bucket is located. Region *string `xml:"Region"` // The ID of the resource group to which the bucket belongs. ResourceGroupId *string `xml:"ResourceGroupId"` }
type BwTokenBucket ¶
func (*BwTokenBucket) LimitBandwidth ¶
func (tb *BwTokenBucket) LimitBandwidth(n int)
type BwTokenBuckets ¶
type BwTokenBuckets [BwTokenBucketSlots]*BwTokenBucket
type CSVSelectInput ¶
type CSVSelectInput struct { FileHeaderInfo *string `xml:"FileHeaderInfo"` RecordDelimiter *string `xml:"RecordDelimiter"` FieldDelimiter *string `xml:"FieldDelimiter"` QuoteCharacter *string `xml:"QuoteCharacter"` CommentCharacter *string `xml:"CommentCharacter"` Range *string `xml:"Range"` SplitRange *string AllowQuotedRecordDelimiter *bool `xml:"AllowQuotedRecordDelimiter"` }
type CSVSelectOutput ¶
type CanceledError ¶
type CanceledError struct {
Err error
}
func (*CanceledError) CanceledError ¶
func (*CanceledError) CanceledError() bool
func (*CanceledError) Error ¶
func (e *CanceledError) Error() string
func (*CanceledError) Unwrap ¶
func (e *CanceledError) Unwrap() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AbortMultipartUpload ¶
func (c *Client) AbortMultipartUpload(ctx context.Context, request *AbortMultipartUploadRequest, optFns ...func(*Options)) (*AbortMultipartUploadResult, error)
AbortMultipartUpload Cancels a multipart upload task and deletes the parts uploaded in the task.
func (*Client) AppendFile ¶
func (c *Client) AppendFile(ctx context.Context, bucket string, key string, optFns ...func(*AppendOptions)) (*AppendOnlyFile, error)
AppendFile opens or creates the named file for appending.
func (*Client) AppendObject ¶
func (c *Client) AppendObject(ctx context.Context, request *AppendObjectRequest, optFns ...func(*Options)) (*AppendObjectResult, error)
AppendObject Uploads an object by appending the object to an existing object. Objects created by using the AppendObject operation are appendable objects.
func (*Client) AsyncProcessObject ¶
func (c *Client) AsyncProcessObject(ctx context.Context, request *AsyncProcessObjectRequest, optFns ...func(*Options)) (*AsyncProcessObjectResult, error)
AsyncProcessObject apply async process on the specified image file.
func (*Client) CompleteMultipartUpload ¶
func (c *Client) CompleteMultipartUpload(ctx context.Context, request *CompleteMultipartUploadRequest, optFns ...func(*Options)) (*CompleteMultipartUploadResult, error)
CompleteMultipartUpload Completes the multipart upload task of an object after all parts of the object are uploaded.
func (*Client) CopyObject ¶
func (c *Client) CopyObject(ctx context.Context, request *CopyObjectRequest, optFns ...func(*Options)) (*CopyObjectResult, error)
CopyObject Copies objects within a bucket or between buckets in the same region
func (*Client) CreateSelectObjectMeta ¶
func (c *Client) CreateSelectObjectMeta(ctx context.Context, request *CreateSelectObjectMetaRequest, optFns ...func(*Options)) (*CreateSelectObjectMetaResult, error)
CreateSelectObjectMeta You can call the CreateSelectObjectMeta operation to obtain information about an object, such as the total number of rows and the number of splits.
func (*Client) DeleteBucket ¶
func (c *Client) DeleteBucket(ctx context.Context, request *DeleteBucketRequest, optFns ...func(*Options)) (*DeleteBucketResult, error)
DeleteBucket Deletes a bucket.
func (*Client) DeleteMultipleObjects ¶
func (c *Client) DeleteMultipleObjects(ctx context.Context, request *DeleteMultipleObjectsRequest, optFns ...func(*Options)) (*DeleteMultipleObjectsResult, error)
DeleteMultipleObjects Deletes multiple objects from a bucket.
func (*Client) DeleteObject ¶
func (c *Client) DeleteObject(ctx context.Context, request *DeleteObjectRequest, optFns ...func(*Options)) (*DeleteObjectResult, error)
DeleteObject Deletes an object.
func (*Client) DeleteObjectTagging ¶
func (c *Client) DeleteObjectTagging(ctx context.Context, request *DeleteObjectTaggingRequest, optFns ...func(*Options)) (*DeleteObjectTaggingResult, error)
DeleteObjectTagging You can call this operation to delete the tags of a specified object.
func (*Client) GetBucketAcl ¶
func (c *Client) GetBucketAcl(ctx context.Context, request *GetBucketAclRequest, optFns ...func(*Options)) (*GetBucketAclResult, error)
GetBucketAcl You can call this operation to query the ACL of a bucket.
func (*Client) GetBucketInfo ¶
func (c *Client) GetBucketInfo(ctx context.Context, request *GetBucketInfoRequest, optFns ...func(*Options)) (*GetBucketInfoResult, error)
GetBucketInfo Queries information about a bucket.
func (*Client) GetBucketLocation ¶
func (c *Client) GetBucketLocation(ctx context.Context, request *GetBucketLocationRequest, optFns ...func(*Options)) (*GetBucketLocationResult, error)
GetBucketLocation Queries the region of an Object Storage Service (OSS) bucket.
func (*Client) GetBucketRequestPayment ¶
func (c *Client) GetBucketRequestPayment(ctx context.Context, request *GetBucketRequestPaymentRequest, optFns ...func(*Options)) (*GetBucketRequestPaymentResult, error)
GetBucketRequestPayment You can call this operation to obtain pay-by-requester configurations for a bucket.
func (*Client) GetBucketStat ¶
func (c *Client) GetBucketStat(ctx context.Context, request *GetBucketStatRequest, optFns ...func(*Options)) (*GetBucketStatResult, error)
GetBucketStat Queries the storage capacity of a specified bucket and the number of objects that are stored in the bucket.
func (*Client) GetBucketVersioning ¶
func (c *Client) GetBucketVersioning(ctx context.Context, request *GetBucketVersioningRequest, optFns ...func(*Options)) (*GetBucketVersioningResult, error)
GetBucketVersioning You can call this operation to query the versioning state of a bucket.
func (*Client) GetObject ¶
func (c *Client) GetObject(ctx context.Context, request *GetObjectRequest, optFns ...func(*Options)) (*GetObjectResult, error)
func (*Client) GetObjectAcl ¶
func (c *Client) GetObjectAcl(ctx context.Context, request *GetObjectAclRequest, optFns ...func(*Options)) (*GetObjectAclResult, error)
GetObjectAcl Queries the access control list (ACL) of an object in a bucket.
func (*Client) GetObjectMeta ¶
func (c *Client) GetObjectMeta(ctx context.Context, request *GetObjectMetaRequest, optFns ...func(*Options)) (*GetObjectMetaResult, error)
GetObjectMeta Queries the metadata of an object, including ETag, Size, and LastModified. The content of the object is not returned.
func (*Client) GetObjectTagging ¶
func (c *Client) GetObjectTagging(ctx context.Context, request *GetObjectTaggingRequest, optFns ...func(*Options)) (*GetObjectTaggingResult, error)
GetObjectTagging You can call this operation to query the tags of an object.
func (*Client) GetObjectToFile ¶
func (c *Client) GetObjectToFile(ctx context.Context, request *GetObjectRequest, filePath string, optFns ...func(*Options)) (*GetObjectResult, error)
GetObjectToFile downloads the object into a local file.
func (*Client) GetSymlink ¶
func (c *Client) GetSymlink(ctx context.Context, request *GetSymlinkRequest, optFns ...func(*Options)) (*GetSymlinkResult, error)
GetSymlink Obtains a symbol link. To perform GetSymlink operations, you must have the read permission on the symbol link.
func (*Client) HeadObject ¶
func (c *Client) HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error)
HeadObject Queries information about all objects in a bucket.
func (*Client) InitiateMultipartUpload ¶
func (c *Client) InitiateMultipartUpload(ctx context.Context, request *InitiateMultipartUploadRequest, optFns ...func(*Options)) (*InitiateMultipartUploadResult, error)
InitiateMultipartUpload Initiates a multipart upload task before you can upload data in parts to Object Storage Service (OSS).
func (*Client) InvokeOperation ¶
func (c *Client) InvokeOperation(ctx context.Context, input *OperationInput, optFns ...func(*Options)) (*OperationOutput, error)
func (*Client) IsBucketExist ¶
func (c *Client) IsBucketExist(ctx context.Context, bucket string, optFns ...func(*Options)) (bool, error)
IsBucketExist checks if the bucket exists.
func (*Client) IsObjectExist ¶
func (c *Client) IsObjectExist(ctx context.Context, bucket string, key string, optFns ...func(*IsObjectExistOptions)) (bool, error)
IsObjectExist checks if the object exists.
func (*Client) ListBuckets ¶
func (c *Client) ListBuckets(ctx context.Context, request *ListBucketsRequest, optFns ...func(*Options)) (*ListBucketsResult, error)
ListBuckets Lists buckets that belong to the current account.
func (*Client) ListMultipartUploads ¶
func (c *Client) ListMultipartUploads(ctx context.Context, request *ListMultipartUploadsRequest, optFns ...func(*Options)) (*ListMultipartUploadsResult, error)
ListMultipartUploads Lists all multipart upload tasks in progress. The tasks are not completed or canceled.
func (*Client) ListObjectVersions ¶
func (c *Client) ListObjectVersions(ctx context.Context, request *ListObjectVersionsRequest, optFns ...func(*Options)) (*ListObjectVersionsResult, error)
ListObjectVersions Lists the versions of all objects in a bucket, including delete markers.
func (*Client) ListObjects ¶
func (c *Client) ListObjects(ctx context.Context, request *ListObjectsRequest, optFns ...func(*Options)) (*ListObjectsResult, error)
ListObjects Lists the information about all objects in a bucket.
func (*Client) ListObjectsV2 ¶
func (c *Client) ListObjectsV2(ctx context.Context, request *ListObjectsV2Request, optFns ...func(*Options)) (*ListObjectsV2Result, error)
ListObjectsV2 Queries information about all objects in a bucket.
func (*Client) ListParts ¶
func (c *Client) ListParts(ctx context.Context, request *ListPartsRequest, optFns ...func(*Options)) (*ListPartsResult, error)
ListParts Lists all parts that are uploaded by using a specified upload ID.
func (*Client) NewCopier ¶
func (c *Client) NewCopier(optFns ...func(*CopierOptions)) *Copier
NewCopier creates a new Copier instance to copy objects.
func (*Client) NewDownloader ¶
func (c *Client) NewDownloader(optFns ...func(*DownloaderOptions)) *Downloader
NewDownloader creates a new Downloader instance to download objects.
func (*Client) NewListBucketsPaginator ¶
func (c *Client) NewListBucketsPaginator(request *ListBucketsRequest, optFns ...func(*PaginatorOptions)) *ListBucketsPaginator
func (*Client) NewListMultipartUploadsPaginator ¶
func (c *Client) NewListMultipartUploadsPaginator(request *ListMultipartUploadsRequest, optFns ...func(*PaginatorOptions)) *ListMultipartUploadsPaginator
func (*Client) NewListObjectVersionsPaginator ¶
func (c *Client) NewListObjectVersionsPaginator(request *ListObjectVersionsRequest, optFns ...func(*PaginatorOptions)) *ListObjectVersionsPaginator
func (*Client) NewListObjectsPaginator ¶
func (c *Client) NewListObjectsPaginator(request *ListObjectsRequest, optFns ...func(*PaginatorOptions)) *ListObjectsPaginator
func (*Client) NewListObjectsV2Paginator ¶
func (c *Client) NewListObjectsV2Paginator(request *ListObjectsV2Request, optFns ...func(*PaginatorOptions)) *ListObjectsV2Paginator
func (*Client) NewListPartsPaginator ¶
func (c *Client) NewListPartsPaginator(request *ListPartsRequest, optFns ...func(*PaginatorOptions)) *ListPartsPaginator
func (*Client) NewUploader ¶
func (c *Client) NewUploader(optFns ...func(*UploaderOptions)) *Uploader
NewUploader creates a new Uploader instance to upload objects.
func (*Client) OpenFile ¶
func (c *Client) OpenFile(ctx context.Context, bucket string, key string, optFns ...func(*OpenOptions)) (*ReadOnlyFile, error)
OpenFile opens the named file for reading.
func (*Client) Presign ¶
func (c *Client) Presign(ctx context.Context, request any, optFns ...func(*PresignOptions)) (*PresignResult, error)
func (*Client) ProcessObject ¶
func (c *Client) ProcessObject(ctx context.Context, request *ProcessObjectRequest, optFns ...func(*Options)) (*ProcessObjectResult, error)
ProcessObject apply process on the specified image file.
func (*Client) PutBucket ¶
func (c *Client) PutBucket(ctx context.Context, request *PutBucketRequest, optFns ...func(*Options)) (*PutBucketResult, error)
PutBucket Creates a bucket.
func (*Client) PutBucketAcl ¶
func (c *Client) PutBucketAcl(ctx context.Context, request *PutBucketAclRequest, optFns ...func(*Options)) (*PutBucketAclResult, error)
PutBucketAcl You can call this operation to configure or modify the ACL of a bucket.
func (*Client) PutBucketRequestPayment ¶
func (c *Client) PutBucketRequestPayment(ctx context.Context, request *PutBucketRequestPaymentRequest, optFns ...func(*Options)) (*PutBucketRequestPaymentResult, error)
PutBucketRequestPayment You can call this operation to enable pay-by-requester for a bucket.
func (*Client) PutBucketVersioning ¶
func (c *Client) PutBucketVersioning(ctx context.Context, request *PutBucketVersioningRequest, optFns ...func(*Options)) (*PutBucketVersioningResult, error)
PutBucketVersioning Configures the versioning state for a bucket.
func (*Client) PutObject ¶
func (c *Client) PutObject(ctx context.Context, request *PutObjectRequest, optFns ...func(*Options)) (*PutObjectResult, error)
PutObject Uploads a object.
func (*Client) PutObjectAcl ¶
func (c *Client) PutObjectAcl(ctx context.Context, request *PutObjectAclRequest, optFns ...func(*Options)) (*PutObjectAclResult, error)
PutObjectAcl You can call this operation to modify the access control list (ACL) of an object.
func (*Client) PutObjectFromFile ¶
func (c *Client) PutObjectFromFile(ctx context.Context, request *PutObjectRequest, filePath string, optFns ...func(*Options)) (*PutObjectResult, error)
PutObjectFromFile creates a new object from the local file.
func (*Client) PutObjectTagging ¶
func (c *Client) PutObjectTagging(ctx context.Context, request *PutObjectTaggingRequest, optFns ...func(*Options)) (*PutObjectTaggingResult, error)
PutObjectTagging Adds tags to an object or updates the tags added to the object. Each tag added to an object is a key-value pair.
func (*Client) PutSymlink ¶
func (c *Client) PutSymlink(ctx context.Context, request *PutSymlinkRequest, optFns ...func(*Options)) (*PutSymlinkResult, error)
PutSymlink Creates a symbolic link that points to a destination object. You can use the symbolic link to access the destination object.
func (*Client) RestoreObject ¶
func (c *Client) RestoreObject(ctx context.Context, request *RestoreObjectRequest, optFns ...func(*Options)) (*RestoreObjectResult, error)
RestoreObject Restores Archive, Cold Archive, or Deep Cold Archive objects.
func (*Client) SelectObject ¶
func (c *Client) SelectObject(ctx context.Context, request *SelectObjectRequest, optFns ...func(*Options)) (*SelectObjectResult, error)
SelectObject Executes SQL statements to perform operations on an object and obtains the execution results.
func (*Client) UploadPart ¶
func (c *Client) UploadPart(ctx context.Context, request *UploadPartRequest, optFns ...func(*Options)) (*UploadPartResult, error)
UploadPart Call the UploadPart interface to upload data in blocks (parts) based on the specified Object name and uploadId.
func (*Client) UploadPartCopy ¶
func (c *Client) UploadPartCopy(ctx context.Context, request *UploadPartCopyRequest, optFns ...func(*Options)) (*UploadPartCopyResult, error)
UploadPartCopy You can call this operation to copy data from an existing object to upload a part by adding a x-oss-copy-request header to UploadPart.
type ClientError ¶
func (*ClientError) Error ¶
func (e *ClientError) Error() string
func (*ClientError) Unwrap ¶
func (e *ClientError) Unwrap() error
type CommonPrefix ¶
type CommonPrefix struct { // The prefix contained in the returned object names. Prefix *string `xml:"Prefix"` }
type CompleteMultipartUpload ¶
type CompleteMultipartUpload struct {
Parts []UploadPart `xml:"Part"`
}
type CompleteMultipartUploadRequest ¶
type CompleteMultipartUploadRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The name of the object. Key *string `input:"path,key,required"` // The ID of the multipart upload task. UploadId *string `input:"query,uploadId,required"` // The encoding type of the object names in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // Specifies whether the object that is uploaded by calling the PutObject operation // overwrites an existing object that has the same name. Valid values: true and false ForbidOverwrite *string `input:"header,x-oss-forbid-overwrite"` // Specifies whether to list all parts that are uploaded by using the current upload ID. Valid value: yes CompleteAll *string `input:"header,x-oss-complete-all"` // The container that stores the content of the CompleteMultipartUpload CompleteMultipartUpload *CompleteMultipartUpload `input:"body,CompleteMultipartUpload,xml"` // The access control list (ACL) of the object. Acl ObjectACLType `input:"header,x-oss-object-acl"` // A callback parameter is a Base64-encoded string that contains multiple fields in the JSON format. Callback *string `input:"header,x-oss-callback"` // Configure custom parameters by using the callback-var parameter. CallbackVar *string `input:"header,x-oss-callback-var"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type CompleteMultipartUploadResult ¶
type CompleteMultipartUploadResult struct { // The version ID of the source object. VersionId *string `output:"header,x-oss-version-id"` // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` // The encoding type of the name of the deleted object in the response. // If encoding-type is specified in the request, the object name is encoded in the returned result. EncodingType *string `xml:"EncodingType"` // The URL that is used to access the uploaded object. Location *string `xml:"Location"` // The name of the bucket. Bucket *string `xml:"Bucket"` // The name of the uploaded object. Key *string `xml:"Key"` // The ETag that is generated when an object is created. // ETags are used to identify the content of objects. ETag *string `xml:"ETag"` CallbackResult map[string]any ResultCommon }
type Config ¶
type Config struct { // The region in which the bucket is located. Region *string // The domain names that other services can use to access OSS. Endpoint *string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. RetryMaxAttempts *int // Retryer guides how HTTP requests should be retried in case of recoverable failures. Retryer retry.Retryer // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HttpClient HTTPClient // The credentials provider to use when signing requests. CredentialsProvider credentials.CredentialsProvider // Allows you to enable the client to use path-style addressing, i.e., https://oss-cn-hangzhou.aliyuncs.com/bucket/key. // By default, the oss client will use virtual hosted addressing i.e., https://bucket.oss-cn-hangzhou.aliyuncs.com/key. UsePathStyle *bool // If the endpoint is s CName, set this flag to true UseCName *bool // Connect timeout ConnectTimeout *time.Duration // read & write timeout ReadWriteTimeout *time.Duration // Skip server certificate verification InsecureSkipVerify *bool // Enable http redirect or not. Default is disable EnabledRedirect *bool // Flag of using proxy host. ProxyHost *string // Read the proxy setting from the environment variables. // HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof). // HTTPS_PROXY takes precedence over HTTP_PROXY for https requests. ProxyFromEnvironment *bool // Upload bandwidth limit in kBytes/s for all request UploadBandwidthlimit *int64 // Download bandwidth limit in kBytes/s for all request DownloadBandwidthlimit *int64 // Authentication with OSS Signature Version SignatureVersion *SignatureVersionType // The level of the output log LogLevel *int // A interface for the SDK to log messages to. LogPrinter LogPrinter // DisableSSL forces the endpoint to be resolved as HTTP. DisableSSL *bool // Dual-stack endpoints are provided in some regions. // This allows an IPv4 client and an IPv6 client to access a bucket by using the same endpoint. // Set this to `true` to use a dual-stack endpoint for the requests. UseDualStackEndpoint *bool // OSS provides the transfer acceleration feature to accelerate date transfers of data // uploads and downloads across countries and regions. // Set this to `true` to use a accelerate endpoint for the requests. UseAccelerateEndpoint *bool // You can use an internal endpoint to communicate between Alibaba Cloud services located within the same // region over the internal network. You are not charged for the traffic generated over the internal network. // Set this to `true` to use a accelerate endpoint for the requests. UseInternalEndpoint *bool // Check data integrity of uploads via the crc64 by default. // This feature takes effect for PutObject, AppendObject, UploadPart, Uploader.UploadFrom and Uploader.UploadFile // Set this to `true` to disable this feature. DisableUploadCRC64Check *bool // Check data integrity of uploads via the crc64 by default. // This feature only takes effect for Downloader.DownloadFile, GetObjectToFile // Set this to `true` to disable this feature. DisableDownloadCRC64Check *bool // Additional signable headers. AdditionalHeaders []string // The optional user specific identifier appended to the User-Agent header. UserAgent *string }
func LoadDefaultConfig ¶
func LoadDefaultConfig() *Config
func (*Config) WithAdditionalHeaders ¶ added in v1.0.1
func (*Config) WithConnectTimeout ¶
func (*Config) WithCredentialsProvider ¶
func (c *Config) WithCredentialsProvider(provider credentials.CredentialsProvider) *Config
func (*Config) WithDisableDownloadCRC64Check ¶
func (*Config) WithDisableSSL ¶
func (*Config) WithDisableUploadCRC64Check ¶
func (*Config) WithDownloadBandwidthlimit ¶
func (*Config) WithEnabledRedirect ¶
func (*Config) WithEndpoint ¶
func (*Config) WithInsecureSkipVerify ¶
func (*Config) WithLogLevel ¶
func (*Config) WithLogPrinter ¶
func (c *Config) WithLogPrinter(printer LogPrinter) *Config
func (*Config) WithProxyFromEnvironment ¶
func (*Config) WithProxyHost ¶
func (*Config) WithReadWriteTimeout ¶
func (*Config) WithRegion ¶
func (*Config) WithRetryMaxAttempts ¶
func (*Config) WithSignatureVersion ¶
func (c *Config) WithSignatureVersion(value SignatureVersionType) *Config
func (*Config) WithUploadBandwidthlimit ¶
func (*Config) WithUseAccelerateEndpoint ¶
func (*Config) WithUseCName ¶
func (*Config) WithUseDualStackEndpoint ¶
func (*Config) WithUseInternalEndpoint ¶
func (*Config) WithUsePathStyle ¶
func (*Config) WithUserAgent ¶ added in v1.0.1
type Copier ¶
type Copier struct {
// contains filtered or unexported fields
}
func NewCopier ¶
func NewCopier(api CopyAPIClient, optFns ...func(*CopierOptions)) *Copier
NewCopier creates a new Copier instance to copy objects. Pass In additional functional options to customize the copier's behavior.
func (*Copier) Copy ¶
func (c *Copier) Copy(ctx context.Context, request *CopyObjectRequest, optFns ...func(*CopierOptions)) (*CopyResult, error)
type CopierOptions ¶
type CopierOptions struct { PartSize int64 ParallelNum int MultipartCopyThreshold int64 LeavePartsOnError bool DisableShallowCopy bool ClientOptions []func(*Options) // MetaProperties and TagProperties takes effect in Copier.Copy MetadataProperties *HeadObjectResult TagProperties *GetObjectTaggingResult }
type CopyAPIClient ¶
type CopyAPIClient interface { HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error) CopyObject(ctx context.Context, request *CopyObjectRequest, optFns ...func(*Options)) (*CopyObjectResult, error) InitiateMultipartUpload(ctx context.Context, request *InitiateMultipartUploadRequest, optFns ...func(*Options)) (*InitiateMultipartUploadResult, error) UploadPartCopy(ctx context.Context, request *UploadPartCopyRequest, optFns ...func(*Options)) (*UploadPartCopyResult, error) CompleteMultipartUpload(ctx context.Context, request *CompleteMultipartUploadRequest, optFns ...func(*Options)) (*CompleteMultipartUploadResult, error) AbortMultipartUpload(ctx context.Context, request *AbortMultipartUploadRequest, optFns ...func(*Options)) (*AbortMultipartUploadResult, error) ListParts(ctx context.Context, request *ListPartsRequest, optFns ...func(*Options)) (*ListPartsResult, error) GetObjectTagging(ctx context.Context, request *GetObjectTaggingRequest, optFns ...func(*Options)) (*GetObjectTaggingResult, error) }
type CopyObjectRequest ¶
type CopyObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The name of the source bucket. SourceBucket *string `input:"nop,bucket"` // The path of the source object. SourceKey *string `input:"nop,key,required"` // The version ID of the source object. SourceVersionId *string `input:"nop,versionId"` // Specifies whether the object that is uploaded by calling the CopyObject operation // overwrites an existing object that has the same name. Valid values: true and false ForbidOverwrite *string `input:"header,x-oss-forbid-overwrite"` // If the ETag specified in the request matches the ETag value of the object, // the object and 200 OK are returned. Otherwise, 412 Precondition Failed is returned. IfMatch *string `input:"header,x-oss-copy-source-if-match"` // If the ETag specified in the request does not match the ETag value of the object, // the object and 200 OK are returned. Otherwise, 304 Not Modified is returned. IfNoneMatch *string `input:"header,x-oss-copy-source-if-none-match"` // If the time specified in this header is earlier than the object modified time or is invalid, // the object and 200 OK are returned. Otherwise, 304 Not Modified is returned. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfModifiedSince *string `input:"header,x-oss-copy-source-if-modified-since"` // If the time specified in this header is the same as or later than the object modified time, // the object and 200 OK are returned. Otherwise, 412 Precondition Failed is returned. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfUnmodifiedSince *string `input:"header,x-oss-copy-source-if-unmodified-since"` // The method that is used to configure the metadata of the destination object. // COPY (default): The metadata of the source object is copied to the destination object. // The configurations of the x-oss-server-side-encryption // header of the source object are not copied to the destination object. // The x-oss-server-side-encryption header in the CopyObject request specifies // the method used to encrypt the destination object. // REPLACE: The metadata specified in the request is used as the metadata of the destination object. MetadataDirective *string `input:"header,x-oss-metadata-directive"` // The encryption method on the server side when an object is created. // Valid values: AES256 and KMS ServerSideEncryption *string `input:"header,x-oss-server-side-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). // This header is valid only when the x-oss-server-side-encryption header is set to KMS. ServerSideDataEncryption *string `input:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `input:"header,x-oss-server-side-encryption-key-id"` // The access control list (ACL) of the object. Acl ObjectACLType `input:"header,x-oss-object-acl"` // The storage class of the object. StorageClass StorageClassType `input:"header,x-oss-storage-class"` // The caching behavior of the web page when the object is downloaded. CacheControl *string `input:"header,Cache-Control"` // The method that is used to access the object. ContentDisposition *string `input:"header,Content-Disposition"` // The method that is used to encode the object. ContentEncoding *string `input:"header,Content-Encoding"` // A standard MIME type describing the format of the contents. ContentType *string `input:"header,Content-Type"` // The expiration time of the cache in UTC. Expires *string `input:"header,Expires"` // The metadata of the object that you want to upload. Metadata map[string]string `input:"header,x-oss-meta-,usermeta"` // The tags that are specified for the object by using a key-value pair. // You can specify multiple tags for an object. Example: TagA=A&TagB=B. Tagging *string `input:"header,x-oss-tagging"` // The method that is used to configure tags for the destination object. // Valid values: Copy (default): The tags of the source object are copied to the destination object. // Replace: The tags specified in the request are configured for the destination object. TaggingDirective *string `input:"header,x-oss-tagging-directive"` // Specify the speed limit value. The speed limit value ranges from 245760 to 838860800, with a unit of bit/s. TrafficLimit int64 `input:"header,x-oss-traffic-limit"` // Progress callback function, it works in Copier.Copy only. ProgressFn ProgressFunc // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type CopyObjectResult ¶
type CopyObjectResult struct { // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // The version ID of the source object. SourceVersionId *string `output:"header,x-oss-copy-source-version-id"` // If the requested object is encrypted by using a server-side encryption algorithm based on entropy encoding, // OSS automatically decrypts the object and returns the decrypted object after OSS receives the GetObject request. // The x-oss-server-side-encryption header is included in the response to indicate // the encryption algorithm used to encrypt the object on the server. ServerSideEncryption *string `output:"header,x-oss-server-side-encryption"` //The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). ServerSideDataEncryption *string `output:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `output:"header,x-oss-server-side-encryption-key-id"` // The time when the returned objects were last modified. LastModified *time.Time `xml:"LastModified"` // The entity tag (ETag). An ETag is created when an object is created to identify the content of the object. ETag *string `xml:"ETag"` ResultCommon }
type CopyResult ¶
type CopyResult struct { UploadId *string ETag *string VersionId *string HashCRC64 *string ResultCommon }
type CreateBucketConfiguration ¶
type CreateBucketConfiguration struct { XMLName xml.Name `xml:"CreateBucketConfiguration"` // The storage class of the bucket. StorageClass StorageClassType `xml:"StorageClass,omitempty"` // The redundancy type of the bucket. DataRedundancyType DataRedundancyType `xml:"DataRedundancyType,omitempty"` }
type CreateSelectObjectMetaRequest ¶
type CreateSelectObjectMetaRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The name of the object. Key *string `input:"path,key,required"` MetaRequest any `input:"nop,meta-request,required"` RequestCommon }
type CsvMetaRequest ¶
type CsvMetaRequest struct { InputSerialization *InputSerialization `xml:"InputSerialization"` OverwriteIfExists *bool `xml:"OverwriteIfExists"` }
type DataRedundancyType ¶
type DataRedundancyType string
DataRedundancyType The redundancy type of the bucket
const ( // DataRedundancyLRS Locally redundant storage (LRS) stores copies of each object across different devices in the same zone. // This ensures data reliability and availability even if two storage devices are damaged at the same time. DataRedundancyLRS DataRedundancyType = "LRS" // DataRedundancyZRS Zone-redundant storage (ZRS) uses the multi-zone mechanism to distribute user data across // multiple zones in the same region. If one zone becomes unavailable, you can continue to access the data // that is stored in other zones. DataRedundancyZRS DataRedundancyType = "ZRS" )
Enum values for BucketACLType
type DeleteBucketRequest ¶
type DeleteBucketRequest struct { // The name of the bucket to delete. Bucket *string `input:"host,bucket,required"` RequestCommon }
type DeleteBucketResult ¶
type DeleteBucketResult struct {
ResultCommon
}
type DeleteMultipleObjectsRequest ¶
type DeleteMultipleObjectsRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The encoding type of the object names in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // The size of the data in the HTTP message body. Unit: bytes. ContentLength int64 `input:"header,Content-Length"` // The container that stores information about you want to delete objects. Objects []DeleteObject `input:"nop,objects,required"` // Specifies whether to enable the Quiet return mode. // The DeleteMultipleObjects operation provides the following return modes: Valid value: true,false Quiet bool // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type DeleteMultipleObjectsResult ¶
type DeleteMultipleObjectsResult struct { // The container that stores information about the deleted objects. DeletedObjects []DeletedInfo `xml:"Deleted"` // The encoding type of the name of the deleted object in the response. // If encoding-type is specified in the request, the object name is encoded in the returned result. EncodingType *string `xml:"EncodingType"` ResultCommon }
type DeleteObject ¶
type DeleteObjectRequest ¶
type DeleteObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The version ID of the source object. VersionId *string `input:"query,versionId"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type DeleteObjectResult ¶
type DeleteObjectResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. DeleteMarker bool `output:"header,x-oss-delete-marker"` ResultCommon }
type DeleteObjectTaggingRequest ¶
type DeleteObjectTaggingRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // Version of the object. VersionId *string `input:"query,versionId"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type DeleteObjectTaggingResult ¶
type DeleteObjectTaggingResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` ResultCommon }
type DeletedInfo ¶
type DeletedInfo struct { // The name of the deleted object. Key *string `xml:"Key"` // The version ID of the object that you deleted. VersionId *string `xml:"VersionId"` // Indicates whether the deleted version is a delete marker. DeleteMarker bool `xml:"DeleteMarker"` // The version ID of the delete marker. DeleteMarkerVersionId *string `xml:"DeleteMarkerVersionId"` }
type DeserializationError ¶
func (*DeserializationError) Error ¶
func (e *DeserializationError) Error() string
func (*DeserializationError) Unwrap ¶
func (e *DeserializationError) Unwrap() error
type DiscardReadCloser ¶
type DiscardReadCloser struct { RC io.ReadCloser Discard int }
func (*DiscardReadCloser) Close ¶
func (drc *DiscardReadCloser) Close() error
type DownloadAPIClient ¶
type DownloadAPIClient interface { HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error) GetObject(ctx context.Context, request *GetObjectRequest, optFns ...func(*Options)) (*GetObjectResult, error) }
type DownloadError ¶
func (*DownloadError) Error ¶
func (m *DownloadError) Error() string
func (*DownloadError) Unwrap ¶
func (m *DownloadError) Unwrap() error
type DownloadResult ¶
type DownloadResult struct {
Written int64
}
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
func NewDownloader ¶
func NewDownloader(c DownloadAPIClient, optFns ...func(*DownloaderOptions)) *Downloader
NewDownloader creates a new Downloader instance to downloads objects. Pass in additional functional options to customize the downloader behavior.
func (*Downloader) DownloadFile ¶
func (d *Downloader) DownloadFile(ctx context.Context, request *GetObjectRequest, filePath string, optFns ...func(*DownloaderOptions)) (result *DownloadResult, err error)
type DownloaderOptions ¶
type EncryptionClient ¶
type EncryptionClient struct {
// contains filtered or unexported fields
}
func NewEncryptionClient ¶
func NewEncryptionClient(c *Client, masterCipher crypto.MasterCipher, optFns ...func(*EncryptionClientOptions)) (*EncryptionClient, error)
func (*EncryptionClient) AbortMultipartUpload ¶
func (e *EncryptionClient) AbortMultipartUpload(ctx context.Context, request *AbortMultipartUploadRequest, optFns ...func(*Options)) (*AbortMultipartUploadResult, error)
AbortMultipartUpload Cancels a multipart upload task and deletes the parts uploaded in the task.
func (*EncryptionClient) CompleteMultipartUpload ¶
func (e *EncryptionClient) CompleteMultipartUpload(ctx context.Context, request *CompleteMultipartUploadRequest, optFns ...func(*Options)) (*CompleteMultipartUploadResult, error)
CompleteMultipartUpload Completes the multipart upload task of an object after all parts of the object are uploaded.
func (*EncryptionClient) GetObject ¶
func (e *EncryptionClient) GetObject(ctx context.Context, request *GetObjectRequest, optFns ...func(*Options)) (*GetObjectResult, error)
GetObject Downloads a object.
func (*EncryptionClient) GetObjectMeta ¶
func (e *EncryptionClient) GetObjectMeta(ctx context.Context, request *GetObjectMetaRequest, optFns ...func(*Options)) (*GetObjectMetaResult, error)
GetObjectMeta Queries the metadata of an object, including ETag, Size, and LastModified. The content of the object is not returned.
func (*EncryptionClient) HeadObject ¶
func (e *EncryptionClient) HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error)
HeadObject Queries information about all objects in a bucket.
func (*EncryptionClient) InitiateMultipartUpload ¶
func (e *EncryptionClient) InitiateMultipartUpload(ctx context.Context, request *InitiateMultipartUploadRequest, optFns ...func(*Options)) (*InitiateMultipartUploadResult, error)
InitiateMultipartUpload Initiates a multipart upload task before you can upload data in parts to Object Storage Service (OSS).
func (*EncryptionClient) ListParts ¶
func (e *EncryptionClient) ListParts(ctx context.Context, request *ListPartsRequest, optFns ...func(*Options)) (*ListPartsResult, error)
ListParts Lists all parts that are uploaded by using a specified upload ID.
func (*EncryptionClient) NewDownloader ¶
func (c *EncryptionClient) NewDownloader(optFns ...func(*DownloaderOptions)) *Downloader
NewDownloader creates a new Downloader instance to download objects.
func (*EncryptionClient) NewUploader ¶
func (c *EncryptionClient) NewUploader(optFns ...func(*UploaderOptions)) *Uploader
NewUploader creates a new Uploader instance to upload objects.
func (*EncryptionClient) OpenFile ¶
func (c *EncryptionClient) OpenFile(ctx context.Context, bucket string, key string, optFns ...func(*OpenOptions)) (*ReadOnlyFile, error)
OpenFile opens the named file for reading.
func (*EncryptionClient) PutObject ¶
func (e *EncryptionClient) PutObject(ctx context.Context, request *PutObjectRequest, optFns ...func(*Options)) (*PutObjectResult, error)
PutObject Uploads a object.
func (*EncryptionClient) Unwrap ¶
func (e *EncryptionClient) Unwrap() *Client
func (*EncryptionClient) UploadPart ¶
func (e *EncryptionClient) UploadPart(ctx context.Context, request *UploadPartRequest, optFns ...func(*Options)) (*UploadPartResult, error)
UploadPart Call the UploadPart interface to upload data in blocks (parts) based on the specified Object name and uploadId.
type EncryptionClientOptions ¶
type EncryptionClientOptions struct {
MasterCiphers []crypto.MasterCipher
}
type EncryptionMultiPartContext ¶
type EncryptionMultiPartContext struct { ContentCipher crypto.ContentCipher DataSize int64 PartSize int64 }
EncryptionMultiPartContext save encryption or decryption information
func (EncryptionMultiPartContext) Valid ¶
func (ec EncryptionMultiPartContext) Valid() bool
Valid judge PartCryptoContext is valid or not
type EndpointType ¶
type EndpointType int
const ( // Access OSS over the public network, oss-[region].aliyuncs.com EndpointPublic EndpointType = iota // Access OSS over the internal network, oss-[region]-internal.aliyuncs.com EndpointInternal // Access OSS over the global acceleration endpoint, oss-accelerate.aliyuncs.com EndpointAccelerate // Access OSS over the acceleration endpoint outside the Chinese mainland, oss-accelerate-overseas.aliyuncs.com EndpointAccelerateOverseas // Access OSS over the dual stack endpoint that support both IPv4 and IPv6, [region].oss.aliyuncs.com EndpointDualStack )
type FeatureFlagsType ¶
type FeatureFlagsType int
const ( // FeatureCorrectClockSkew If the client time is different from server time by more than about 15 minutes, // the requests your application makes will be signed with the incorrect time, and the server will reject them. // The feature to help to identify this case, and SDK will correct for clock skew. FeatureCorrectClockSkew FeatureFlagsType = 1 << iota FeatureEnableMD5 // FeatureAutoDetectMimeType Content-Type is automatically added based on the object name if not specified. // This feature takes effect for PutObject, AppendObject and InitiateMultipartUpload FeatureAutoDetectMimeType // FeatureEnableCRC64CheckUpload check data integrity of uploads via the crc64. // This feature takes effect for PutObject, AppendObject, UploadPart, Uploader.UploadFrom and Uploader.UploadFile FeatureEnableCRC64CheckUpload // FeatureEnableCRC64CheckDownload check data integrity of downloads via the crc64. // This feature takes effect for Downloader.DownloadFile FeatureEnableCRC64CheckDownload FeatureFlagsDefault = FeatureCorrectClockSkew + FeatureAutoDetectMimeType + FeatureEnableCRC64CheckUpload + FeatureEnableCRC64CheckDownload )
type GetBucketAclRequest ¶
type GetBucketAclRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` RequestCommon }
type GetBucketAclResult ¶
type GetBucketAclResult struct { // The container that stores the access control list (ACL) information about the bucket. ACL *string `xml:"AccessControlList>Grant"` // The container that stores information about the bucket owner. Owner *Owner `xml:"Owner"` ResultCommon }
type GetBucketInfoRequest ¶
type GetBucketInfoRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` RequestCommon }
type GetBucketInfoResult ¶
type GetBucketInfoResult struct { // The container that stores the bucket information. BucketInfo BucketInfo `xml:"Bucket"` ResultCommon }
type GetBucketLocationRequest ¶
type GetBucketLocationRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` RequestCommon }
type GetBucketLocationResult ¶
type GetBucketLocationResult struct { // The region in which the bucket is located. LocationConstraint *string `xml:",chardata"` ResultCommon }
type GetBucketRequestPaymentRequest ¶
type GetBucketRequestPaymentRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` RequestCommon }
type GetBucketRequestPaymentResult ¶
type GetBucketRequestPaymentResult struct { // Indicates who pays the download and request fees. Payer *string `xml:"Payer"` ResultCommon }
type GetBucketStatRequest ¶
type GetBucketStatRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` RequestCommon }
type GetBucketStatResult ¶
type GetBucketStatResult struct { // The storage capacity of the bucket. Unit: bytes. Storage int64 `xml:"Storage"` // The total number of objects that are stored in the bucket. ObjectCount int64 `xml:"ObjectCount"` // The number of multipart upload tasks that have been initiated but are not completed or canceled. MultipartUploadCount int64 `xml:"MultipartUploadCount"` // The number of LiveChannels in the bucket. LiveChannelCount int64 `xml:"LiveChannelCount"` // The time when the obtained information is last modified. The value of this element is a UNIX timestamp. Unit: seconds. LastModifiedTime int64 `xml:"LastModifiedTime"` // The storage usage of Standard objects in the bucket. Unit: bytes. StandardStorage int64 `xml:"StandardStorage"` // The number of Standard objects in the bucket. StandardObjectCount int64 `xml:"StandardObjectCount"` // The billed storage usage of Infrequent Access (IA) objects in the bucket. Unit: bytes. InfrequentAccessStorage int64 `xml:"InfrequentAccessStorage"` // The actual storage usage of IA objects in the bucket. Unit: bytes. InfrequentAccessRealStorage int64 `xml:"InfrequentAccessRealStorage"` // The number of IA objects in the bucket. InfrequentAccessObjectCount int64 `xml:"InfrequentAccessObjectCount"` // The billed storage usage of Archive objects in the bucket. Unit: bytes. ArchiveStorage int64 `xml:"ArchiveStorage"` // The actual storage usage of Archive objects in the bucket. Unit: bytes. ArchiveRealStorage int64 `xml:"ArchiveRealStorage"` // The number of Archive objects in the bucket. ArchiveObjectCount int64 `xml:"ArchiveObjectCount"` // The billed storage usage of Cold Archive objects in the bucket. Unit: bytes. ColdArchiveStorage int64 `xml:"ColdArchiveStorage"` // The actual storage usage of Cold Archive objects in the bucket. Unit: bytes. ColdArchiveRealStorage int64 `xml:"ColdArchiveRealStorage"` // The number of Cold Archive objects in the bucket. ColdArchiveObjectCount int64 `xml:"ColdArchiveObjectCount"` ResultCommon }
type GetBucketVersioningRequest ¶
type GetBucketVersioningRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` RequestCommon }
type GetBucketVersioningResult ¶
type GetBucketVersioningResult struct { // The versioning state of the bucket. Valid values: Enabled,Suspended VersionStatus *string `xml:"Status"` ResultCommon }
type GetObjectAclRequest ¶
type GetObjectAclRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The version ID of the source object. VersionId *string `input:"query,versionId"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type GetObjectAclResult ¶
type GetObjectAclResult struct { // The ACL of the object. Default value: default. ACL *string `xml:"AccessControlList>Grant"` // The container that stores information about the object owner. Owner *Owner `xml:"Owner"` // Version of the object. VersionId *string `output:"header,x-oss-version-id"` ResultCommon }
type GetObjectMetaRequest ¶
type GetObjectMetaRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The version ID of the source object. VersionId *string `input:"query,versionId"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type GetObjectMetaResult ¶
type GetObjectMetaResult struct { // Size of the body in bytes. -1 indicates that the Content-Length dose not exist. ContentLength int64 `output:"header,Content-Length"` // The entity tag (ETag). An ETag is created when an object is created to identify the content of the object. ETag *string `output:"header,ETag"` // The time when the returned objects were last modified. LastModified *time.Time `output:"header,Last-Modified,time"` // The time when the object was last accessed. LastAccessTime *time.Time `output:"header,x-oss-last-access-time,time"` // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` ResultCommon }
type GetObjectRequest ¶
type GetObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // If the ETag specified in the request matches the ETag value of the object, // the object and 200 OK are returned. Otherwise, 412 Precondition Failed is returned. IfMatch *string `input:"header,If-Match"` // If the ETag specified in the request does not match the ETag value of the object, // the object and 200 OK are returned. Otherwise, 304 Not Modified is returned. IfNoneMatch *string `input:"header,If-None-Match"` // If the time specified in this header is earlier than the object modified time or is invalid, // the object and 200 OK are returned. Otherwise, 304 Not Modified is returned. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfModifiedSince *string `input:"header,If-Modified-Since"` // If the time specified in this header is the same as or later than the object modified time, // the object and 200 OK are returned. Otherwise, 412 Precondition Failed is returned. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfUnmodifiedSince *string `input:"header,If-Unmodified-Since"` // The content range of the object to be returned. // If the value of Range is valid, the total size of the object and the content range are returned. // For example, Content-Range: bytes 0~9/44 indicates that the total size of the object is 44 bytes, // and the range of data returned is the first 10 bytes. // However, if the value of Range is invalid, the entire object is returned, // and the response does not include the Content-Range parameter. Range *string `input:"header,Range"` // Specify standard behaviors to download data by range // If the value is "standard", the download behavior is modified when the specified range is not within the valid range. // For an object whose size is 1,000 bytes: // 1) If you set Range: bytes to 500-2000, the value at the end of the range is invalid. // In this case, OSS returns HTTP status code 206 and the data that is within the range of byte 500 to byte 999. // 2) If you set Range: bytes to 1000-2000, the value at the start of the range is invalid. // In this case, OSS returns HTTP status code 416 and the InvalidRange error code. RangeBehavior *string `input:"header,x-oss-range-behavior"` // The cache-control header to be returned in the response. ResponseCacheControl *string `input:"query,response-cache-control"` // The content-disposition header to be returned in the response. ResponseContentDisposition *string `input:"query,response-content-disposition"` // The content-encoding header to be returned in the response. ResponseContentEncoding *string `input:"query,response-content-encoding"` // The content-language header to be returned in the response. ResponseContentLanguage *string `input:"query,response-content-language"` // The content-type header to be returned in the response. ResponseContentType *string `input:"query,response-content-type"` // The expires header to be returned in the response. ResponseExpires *string `input:"query,response-expires"` // VersionId used to reference a specific version of the object. VersionId *string `input:"query,versionId"` // Specify the speed limit value. The speed limit value ranges from 245760 to 838860800, with a unit of bit/s. TrafficLimit int64 `input:"header,x-oss-traffic-limit"` // Progress callback function ProgressFn ProgressFunc // Image processing parameters Process *string `input:"query,x-oss-process"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type GetObjectResult ¶
type GetObjectResult struct { // Size of the body in bytes. -1 indicates that the Content-Length dose not exist. ContentLength int64 `output:"header,Content-Length"` // The portion of the object returned in the response. ContentRange *string `output:"header,Content-Range"` // A standard MIME type describing the format of the object data. ContentType *string `output:"header,Content-Type"` // The entity tag (ETag). An ETag is created when an object is created to identify the content of the object. ETag *string `output:"header,ETag"` // The time when the returned objects were last modified. LastModified *time.Time `output:"header,Last-Modified,time"` // The storage class of the object. StorageClass *string `output:"header,x-oss-storage-class"` // Content-Md5 for the uploaded object. ContentMD5 *string `output:"header,Content-MD5"` // A map of metadata to store with the object. Metadata map[string]string `output:"header,x-oss-meta-,usermeta"` // If the requested object is encrypted by using a server-side encryption algorithm based on entropy encoding, // OSS automatically decrypts the object and returns the decrypted object after OSS receives the GetObject request. // The x-oss-server-side-encryption header is included in the response to indicate // the encryption algorithm used to encrypt the object on the server. ServerSideEncryption *string `output:"header,x-oss-server-side-encryption"` //The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). ServerSideDataEncryption *string `output:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `output:"header,x-oss-server-side-encryption-key-id"` // The type of the object. ObjectType *string `output:"header,x-oss-object-type"` // The position for the next append operation. // If the type of the object is Appendable, this header is included in the response. NextAppendPosition *string `output:"header,x-oss-next-append-position"` // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` // The lifecycle information about the object. // If lifecycle rules are configured for the object, this header is included in the response. // This header contains the following parameters: expiry-date that indicates the expiration time of the object, // and rule-id that indicates the ID of the matched lifecycle rule. Expiration *string `output:"header,x-oss-expiration"` // The status of the object when you restore an object. // If the storage class of the bucket is Archive and a RestoreObject request is submitted, Restore *string `output:"header,x-oss-restore"` // The result of an event notification that is triggered for the object. ProcessStatus *string `output:"header,x-oss-process-status"` // The number of tags added to the object. // This header is included in the response only when you have read permissions on tags. TaggingCount int32 `output:"header,x-oss-tagging-count"` // Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. DeleteMarker bool `output:"header,x-oss-delete-marker"` // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // Object data. Body io.ReadCloser ResultCommon }
type GetObjectTaggingRequest ¶
type GetObjectTaggingRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // Version of the object. VersionId *string `input:"query,versionId"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type GetObjectTaggingResult ¶
type GetObjectTaggingResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // The container used to store the collection of tags. Tags []Tag `xml:"TagSet>Tag"` ResultCommon }
type GetSymlinkRequest ¶
type GetSymlinkRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // Version of the object. VersionId *string `input:"query,versionId"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type GetSymlinkResult ¶
type GetSymlinkResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // Indicates the target object that the symbol link directs to. Target *string `output:"header,x-oss-symlink-target"` // Entity tag for the uploaded object. ETag *string `output:"header,ETag"` // The metadata of the object that you want to symlink. Metadata map[string]string `output:"header,x-oss-meta-,usermeta"` ResultCommon }
type HTTPContentRange ¶
func (HTTPContentRange) FormatHTTPContentRange ¶
func (r HTTPContentRange) FormatHTTPContentRange() *string
type HTTPRange ¶
func ParseRange ¶
ParseRange parses a HTTPRange from a Range: header. It only accepts single ranges.
func (HTTPRange) FormatHTTPRange ¶
type HeadObjectRequest ¶
type HeadObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The version ID of the source object. VersionId *string `input:"query,versionId"` // If the ETag specified in the request matches the ETag value of the object, // the object and 200 OK are returned. Otherwise, 412 Precondition Failed is returned. IfMatch *string `input:"header,If-Match"` // If the ETag specified in the request does not match the ETag value of the object, // the object and 200 OK are returned. Otherwise, 304 Not Modified is returned. IfNoneMatch *string `input:"header,If-None-Match"` // If the time specified in this header is earlier than the object modified time or is invalid, // the object and 200 OK are returned. Otherwise, 304 Not Modified is returned. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfModifiedSince *string `input:"header,If-Modified-Since"` // If the time specified in this header is the same as or later than the object modified time, // the object and 200 OK are returned. Otherwise, 412 Precondition Failed is returned. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfUnmodifiedSince *string `input:"header,If-Unmodified-Since"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type HeadObjectResult ¶
type HeadObjectResult struct { // Size of the body in bytes. -1 indicates that the Content-Length dose not exist. ContentLength int64 `output:"header,Content-Length"` // A standard MIME type describing the format of the object data. ContentType *string `output:"header,Content-Type"` // The entity tag (ETag). An ETag is created when an object is created to identify the content of the object. ETag *string `output:"header,ETag"` // The time when the returned objects were last modified. LastModified *time.Time `output:"header,Last-Modified,time"` // The storage class of the object. StorageClass *string `output:"header,x-oss-storage-class"` // Content-Md5 for the uploaded object. ContentMD5 *string `output:"header,Content-MD5"` // A map of metadata to store with the object. Metadata map[string]string `output:"header,x-oss-meta-,usermeta"` // If the requested object is encrypted by using a server-side encryption algorithm based on entropy encoding, // OSS automatically decrypts the object and returns the decrypted object after OSS receives the GetObject request. // The x-oss-server-side-encryption header is included in the response to indicate // the encryption algorithm used to encrypt the object on the server. ServerSideEncryption *string `output:"header,x-oss-server-side-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). ServerSideDataEncryption *string `output:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `output:"header,x-oss-server-side-encryption-key-id"` // The type of the object. ObjectType *string `output:"header,x-oss-object-type"` // The position for the next append operation. // If the type of the object is Appendable, this header is included in the response. NextAppendPosition *string `output:"header,x-oss-next-append-position"` // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` // The lifecycle information about the object. // If lifecycle rules are configured for the object, this header is included in the response. // This header contains the following parameters: expiry-date that indicates the expiration time of the object, // and rule-id that indicates the ID of the matched lifecycle rule. Expiration *string `output:"header,x-oss-expiration"` // The status of the object when you restore an object. // If the storage class of the bucket is Archive and a RestoreObject request is submitted, Restore *string `output:"header,x-oss-restore"` // The result of an event notification that is triggered for the object. ProcessStatus *string `output:"header,x-oss-process-status"` // The requester. This header is included in the response if the pay-by-requester mode // is enabled for the bucket and the requester is not the bucket owner. The value of this header is requester RequestCharged *string `output:"header,x-oss-request-charged"` // The number of tags added to the object. // This header is included in the response only when you have read permissions on tags. TaggingCount int32 `output:"header,x-oss-tagging-count"` // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // The origins allowed for cross-origin resource sharing (CORS). // If a CORS rule is configured for the bucket that stores the object and the Origin header // in the request meets the CORS rule, this header is included in the response. AllowOrigin *string `output:"header,Access-Control-Allow-Origin"` // The methods allowed for CORS. If a CORS rule is configured for the bucket that stores the object // and the Access-Control-Request-Method header in the request meets the CORS rule, this header is included in the response. AllowMethods *string `output:"header,Access-Control-Allow-Methods"` // The maximum caching period for CORS. If a CORS rule is configured for the bucket that stores // the object and the request meets the CORS rule, this header is included in the response. AllowAge *string `output:"header,Access-Control-Allow-Age"` // The headers allowed for CORS. If a CORS rule is configured for the bucket that stores // the object and the request meets the CORS rule, this header is included in the response AllowHeaders *string `output:"header,Access-Control-Allow-Headers"` // The headers that can be accessed by JavaScript applications on the client. // If a CORS rule is configured for the bucket that stores the object and the request meets // the CORS rule, this header is included in the response ExposeHeaders *string `output:"header,Access-Control-Expose-Headers"` // The caching behavior of the web page when the object is downloaded. CacheControl *string `output:"header,Cache-Control"` // The method that is used to access the object. ContentDisposition *string `output:"header,Content-Disposition"` // The method that is used to encode the object. ContentEncoding *string `output:"header,Content-Encoding"` // The expiration time of the cache in UTC. Expires *string `output:"header,Expires"` ResultCommon }
type InitiateMultipartUploadRequest ¶
type InitiateMultipartUploadRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The encoding type of the object names in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // The caching behavior of the web page when the object is downloaded. CacheControl *string `input:"header,Cache-Control"` // The method that is used to access the object. ContentDisposition *string `input:"header,Content-Disposition"` // The method that is used to encode the object. ContentEncoding *string `input:"header,Content-Encoding"` // A standard MIME type describing the format of the contents. ContentType *string `input:"header,Content-Type"` // The expiration time of the cache in UTC. Expires *string `input:"header,Expires"` // Specifies whether the InitiateMultipartUpload operation overwrites // the existing object that has the same name as the object that you want to upload. // Valid values: true and false ForbidOverwrite *string `input:"header,x-oss-forbid-overwrite"` // The encryption method on the server side when an object is created. // Valid values: AES256 and KMS ServerSideEncryption *string `input:"header,x-oss-server-side-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). // This header is valid only when the x-oss-server-side-encryption header is set to KMS. ServerSideDataEncryption *string `input:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `input:"header,x-oss-server-side-encryption-key-id"` // The storage class of the object. StorageClass StorageClassType `input:"header,x-oss-storage-class"` // The metadata of the object that you want to upload. Metadata map[string]string `input:"header,x-oss-meta-,usermeta"` // The tags that are specified for the object by using a key-value pair. // You can specify multiple tags for an object. Example: TagA=A&TagB=B. Tagging *string `input:"header,x-oss-tagging"` // The total size when using client side encryption, only valid in EncryptionClient CSEDataSize *int64 // The part size when using client side encryption, only valid in EncryptionClient // CSEPartSize must aligned to the secret iv length CSEPartSize *int64 // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` // To disable the feature that Content-Type is automatically added based on the object name if not specified. DisableAutoDetectMimeType bool RequestCommon }
type InitiateMultipartUploadResult ¶
type InitiateMultipartUploadResult struct { // The name of the bucket to which the object is uploaded by the multipart upload task. Bucket *string `xml:"Bucket"` // The name of the object that is uploaded by the multipart upload task. Key *string `xml:"Key"` // The upload ID that uniquely identifies the multipart upload task. UploadId *string `xml:"UploadId"` // The encoding type of the object names in the response. Valid value: url EncodingType *string `xml:"EncodingType"` // The encryption context for multipart upload when using client side encryption, only valid in EncryptionClient CSEMultiPartContext *EncryptionMultiPartContext ResultCommon }
type InputSerialization ¶
type InputSerialization struct { CSV *InputSerializationCSV `xml:"CSV"` JSON *InputSerializationJSON `xml:"JSON"` CompressionType *string `xml:"CompressionType"` }
type InputSerializationCSV ¶
type InputSerializationJSON ¶
type InputSerializationJSON struct {
JSONType *string `xml:"Type"`
}
type InputSerializationSelect ¶
type InputSerializationSelect struct { CsvBodyInput *CSVSelectInput `xml:"CSV"` JsonBodyInput *JSONSelectInput `xml:"JSON"` CompressionType *string `xml:"CompressionType"` }
type InvalidParamError ¶
func NewErrParamInvalid ¶
func NewErrParamInvalid(field string) InvalidParamError
func NewErrParamNull ¶
func NewErrParamNull(field string) InvalidParamError
func NewErrParamRequired ¶
func NewErrParamRequired(field string) InvalidParamError
func NewErrParamTypeNotSupport ¶
func NewErrParamTypeNotSupport(field string) InvalidParamError
type IsObjectExistOptions ¶
type JSONSelectInput ¶
type JSONSelectOutput ¶
type JSONSelectOutput struct {
RecordDelimiter *string `xml:"RecordDelimiter"`
}
type JsonMetaRequest ¶
type JsonMetaRequest struct { InputSerialization *InputSerialization `xml:"InputSerialization"` OverwriteIfExists *bool `xml:"OverwriteIfExists"` }
type LimitedReadCloser ¶
type LimitedReadCloser struct { *io.LimitedReader io.Closer }
type ListBucketsPaginator ¶
type ListBucketsPaginator struct {
// contains filtered or unexported fields
}
ListBucketsPaginator is a paginator for ListBuckets
func (*ListBucketsPaginator) HasNext ¶
func (p *ListBucketsPaginator) HasNext() bool
HasNext Returns true if there’s a next page.
func (*ListBucketsPaginator) NextPage ¶
func (p *ListBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBucketsResult, error)
NextPage retrieves the next ListBuckets page.
type ListBucketsRequest ¶
type ListBucketsRequest struct { // The name of the bucket from which the list operation begins. Marker *string `input:"query,marker"` // The maximum number of buckets that can be returned in the single query. // Valid values: 1 to 1000. MaxKeys int32 `input:"query,max-keys"` // The prefix that the names of returned buckets must contain. Prefix *string `input:"query,prefix"` // Limits the response to keys that begin with the specified prefix // The ID of the resource group. ResourceGroupId *string `input:"header,x-oss-resource-group-id"` RequestCommon }
type ListBucketsResult ¶
type ListBucketsResult struct { // The prefix contained in the names of the returned bucket. Prefix *string `xml:"Prefix"` // The name of the bucket after which the ListBuckets operation starts. Marker *string `xml:"Marker"` // The marker filter. // The maximum number of buckets that can be returned for the request. MaxKeys int32 `xml:"MaxKeys"` // Indicates whether all results are returned. // true: Only part of the results are returned for the request. // false: All results are returned for the request. IsTruncated bool `xml:"IsTruncated"` // The marker for the next ListBuckets request, which can be used to return the remaining results. NextMarker *string `xml:"NextMarker"` // The container that stores information about the bucket owner. Owner *Owner `xml:"Owner"` // The container that stores information about buckets. Buckets []BucketProperties `xml:"Buckets>Bucket"` ResultCommon }
type ListMultipartUploadsPaginator ¶
type ListMultipartUploadsPaginator struct {
// contains filtered or unexported fields
}
ListMultipartUploadsPaginator is a paginator for ListMultipartUploads
func (*ListMultipartUploadsPaginator) HasNext ¶
func (p *ListMultipartUploadsPaginator) HasNext() bool
HasNext Returns true if there’s a next page.
func (*ListMultipartUploadsPaginator) NextPage ¶
func (p *ListMultipartUploadsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMultipartUploadsResult, error)
NextPage retrieves the next ListMultipartUploads page.
type ListMultipartUploadsRequest ¶
type ListMultipartUploadsRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The character that is used to group objects by name. If you specify the delimiter parameter in the request, // the response contains the CommonPrefixes parameter. The objects whose names contain the same string from // the prefix to the next occurrence of the delimiter are grouped as a single result element in CommonPrefixes. Delimiter *string `input:"query,delimiter"` // The encoding type of the content in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // This parameter is used together with the upload-id-marker parameter to specify // the position from which the next list begins. KeyMarker *string `input:"query,key-marker"` // The maximum number of multipart upload tasks that can be returned for the current request. // Default value: 1000. Maximum value: 1000. MaxUploads int32 `input:"query,max-uploads"` // The prefix that the names of the returned objects must contain. Prefix *string `input:"query,prefix"` // The upload ID of the multipart upload task after which the list begins. // This parameter is used together with the key-marker parameter. UploadIdMarker *string `input:"query,upload-id-marker"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type ListMultipartUploadsResult ¶
type ListMultipartUploadsResult struct { // The method used to encode the object name in the response. // If encoding-type is specified in the request, values of those elements including // Delimiter, KeyMarker, Prefix, NextKeyMarker, and Key are encoded in the returned result. EncodingType *string `xml:"EncodingType"` // The name of the bucket. Bucket *string `xml:"Bucket"` // The name of the object that corresponds to the multipart upload task after which the list begins. KeyMarker *string `xml:"KeyMarker"` // The upload ID of the multipart upload task after which the list begins. UploadIdMarker *string `xml:"UploadIdMarker"` // The upload ID of the multipart upload task after which the list begins. NextKeyMarker *string `xml:"NextKeyMarker"` // The NextUploadMarker value that is used for the UploadMarker value in // the next request if the response does not contain all required results. NextUploadIdMarker *string `xml:"NextUploadIdMarker"` // The character that is used to group objects by name. Delimiter *string `xml:"Delimiter"` // The prefix contained in the returned object names. Prefix *string `xml:"Prefix"` // The maximum number of multipart upload tasks returned by OSS. MaxUploads int32 `xml:"MaxUploads"` // Indicates whether the list of multipart upload tasks returned in the response is truncated. // true: Only part of the results are returned this time. // false: All results are returned. IsTruncated bool `xml:"IsTruncated"` Uploads []Upload `xml:"Upload"` ResultCommon }
type ListObjectVersionsPaginator ¶
type ListObjectVersionsPaginator struct {
// contains filtered or unexported fields
}
ListObjectVersionsPaginator is a paginator for ListObjectVersions
func (*ListObjectVersionsPaginator) HasNext ¶
func (p *ListObjectVersionsPaginator) HasNext() bool
HasNext Returns true if there’s a next page.
func (*ListObjectVersionsPaginator) NextPage ¶
func (p *ListObjectVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectVersionsResult, error)
NextPage retrieves the next ListObjectVersions page.
type ListObjectVersionsRequest ¶
type ListObjectVersionsRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` // The character that is used to group objects by name. If you specify the delimiter parameter in the request, // the response contains the CommonPrefixes parameter. The objects whose names contain the same string from // the prefix to the next occurrence of the delimiter are grouped as a single result element in CommonPrefixes. Delimiter *string `input:"query,delimiter"` // Specifies that objects whose names are alphabetically after the value of the key-marker parameter are returned. // This parameter can be specified together with version-id-marker. // By default, this parameter is left empty. KeyMarker *string `input:"query,key-marker"` // Specifies that the versions created before the version specified by version-id-marker for the object // whose name is specified by key-marker are returned by creation time in descending order. // By default, if this parameter is not specified, the results are returned from the latest // version of the object whose name is alphabetically after the value of key-marker. VersionIdMarker *string `input:"query,version-id-marker"` // The maximum number of objects that you want to return. If the list operation cannot be complete at a time // because the max-keys parameter is specified, the NextMarker element is included in the response as the marker // for the next list operation. MaxKeys int32 `input:"query,max-keys"` // The prefix that the names of the returned objects must contain. Prefix *string `input:"query,prefix"` // The encoding type of the content in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` // To indicate that whether to stores the versions of objects and delete markers together in one container. // When false(default), stores the versions of objects into ListObjectVersionsResult.ObjectVersions, // When false(default), stores the delete markers into ListObjectVersionsResult.ObjectDeleteMarkers, // When true, stores the versions and delete markers into ListObjectVersionsResult.ObjectVersionsDeleteMarkers, IsMix bool RequestCommon }
type ListObjectVersionsResult ¶
type ListObjectVersionsResult struct { // The name of the bucket. Name *string `xml:"Name"` // Indicates the object from which the ListObjectVersions (GetBucketVersions) operation starts. KeyMarker *string `xml:"KeyMarker"` // The version from which the ListObjectVersions (GetBucketVersions) operation starts. // This parameter is used together with KeyMarker. VersionIdMarker *string `xml:"VersionIdMarker"` // If not all results are returned for the request, the NextKeyMarker parameter is included // in the response to indicate the key-marker value of the next ListObjectVersions (GetBucketVersions) request. NextKeyMarker *string `xml:"NextKeyMarker"` // If not all results are returned for the request, the NextVersionIdMarker parameter is included in // the response to indicate the version-id-marker value of the next ListObjectVersions (GetBucketVersions) request. NextVersionIdMarker *string `xml:"NextVersionIdMarker"` // The container that stores delete markers. ObjectDeleteMarkers []ObjectDeleteMarkerProperties `xml:"DeleteMarker"` // The container that stores the versions of objects, excluding delete markers. ObjectVersions []ObjectVersionProperties `xml:"Version"` // The container that stores the versions of objects and delete markers together in the order they are returned. // Only valid when ListObjectVersionsRequest.IsMix is set to true ObjectVersionsDeleteMarkers []ObjectMixProperties `xml:"ObjectMix"` // The prefix contained in the returned object names. Prefix *string `xml:"Prefix"` // The maximum number of returned objects in the response. MaxKeys int32 `xml:"MaxKeys"` // The character that is used to group objects by name. Delimiter *string `xml:"Delimiter"` // Indicates whether the returned results are truncated. // true indicates that not all results are returned this time. // false indicates that all results are returned this time. IsTruncated bool `xml:"IsTruncated"` // The encoding type of the content in the response. EncodingType *string `xml:"EncodingType"` // If the Delimiter parameter is specified in the request, the response contains the CommonPrefixes element. CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"` ResultCommon }
type ListObjectsPaginator ¶
type ListObjectsPaginator struct {
// contains filtered or unexported fields
}
ListObjectsPaginator is a paginator for ListObjects
func (*ListObjectsPaginator) HasNext ¶
func (p *ListObjectsPaginator) HasNext() bool
HasNext Returns true if there’s a next page.
func (*ListObjectsPaginator) NextPage ¶
func (p *ListObjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectsResult, error)
NextPage retrieves the next ListObjects page.
type ListObjectsRequest ¶
type ListObjectsRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` // The character that is used to group objects by name. If you specify the delimiter parameter in the request, // the response contains the CommonPrefixes parameter. The objects whose names contain the same string from // the prefix to the next occurrence of the delimiter are grouped as a single result element in CommonPrefixes. Delimiter *string `input:"query,delimiter"` // The encoding type of the content in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // The name of the object after which the ListObjects (GetBucket) operation starts. // If this parameter is specified, objects whose names are alphabetically greater than the marker value are returned. Marker *string `input:"query,marker"` // The maximum number of objects that you want to return. If the list operation cannot be complete at a time // because the max-keys parameter is specified, the NextMarker element is included in the response as the marker // for the next list operation. MaxKeys int32 `input:"query,max-keys"` // The prefix that the names of the returned objects must contain. Prefix *string `input:"query,prefix"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type ListObjectsResult ¶
type ListObjectsResult struct { // The name of the bucket. Name *string `xml:"Name"` // The prefix contained in the returned object names. Prefix *string `xml:"Prefix"` // The name of the object after which the list operation begins. Marker *string `xml:"Marker"` // The maximum number of returned objects in the response. MaxKeys int32 `xml:"MaxKeys"` // The character that is used to group objects by name. Delimiter *string `xml:"Delimiter"` // Indicates whether the returned results are truncated. // true indicates that not all results are returned this time. // false indicates that all results are returned this time. IsTruncated bool `xml:"IsTruncated"` // The position from which the next list operation starts. NextMarker *string `xml:"NextMarker"` // The encoding type of the content in the response. EncodingType *string `xml:"EncodingType"` // The container that stores the metadata of the returned objects. Contents []ObjectProperties `xml:"Contents"` // If the Delimiter parameter is specified in the request, the response contains the CommonPrefixes element. CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"` ResultCommon }
type ListObjectsV2Paginator ¶
type ListObjectsV2Paginator struct {
// contains filtered or unexported fields
}
ListObjectsV2Paginator is a paginator for ListObjectsV2
func (*ListObjectsV2Paginator) HasNext ¶
func (p *ListObjectsV2Paginator) HasNext() bool
HasNext Returns true if there’s a next page.
func (*ListObjectsV2Paginator) NextPage ¶
func (p *ListObjectsV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectsV2Result, error)
NextPage retrieves the next ListObjectsV2 page.
type ListObjectsV2Request ¶
type ListObjectsV2Request struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` // The character that is used to group objects by name. If you specify the delimiter parameter in the request, // the response contains the CommonPrefixes parameter. The objects whose names contain the same string from // the prefix to the next occurrence of the delimiter are grouped as a single result element in CommonPrefixes. Delimiter *string `input:"query,delimiter"` // The name of the object after which the ListObjectsV2 (GetBucketV2) operation starts. // The objects are returned in alphabetical order of their names. The start-after parameter // is used to list the returned objects by page. // The value of the parameter must be less than 1,024 bytes in length. // Even if the specified start-after value does not exist during a conditional query, // the ListObjectsV2 (GetBucketV2) operation starts from the object whose name is alphabetically greater than the start-after value. // By default, this parameter is left empty. StartAfter *string `input:"query,start-after"` // The token from which the ListObjectsV2 (GetBucketV2) operation must start. // You can obtain the token from the NextContinuationToken parameter in the ListObjectsV2 (GetBucketV2) response. ContinuationToken *string `input:"query,continuation-token"` // The maximum number of objects that you want to return. If the list operation cannot be complete at a time // because the max-keys parameter is specified, the NextMarker element is included in the response as the marker // for the next list operation. MaxKeys int32 `input:"query,max-keys"` // The prefix that the names of the returned objects must contain. Prefix *string `input:"query,prefix"` // The encoding type of the content in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // Specifies whether to include information about the object owner in the response. FetchOwner bool `input:"query,fetch-owner"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type ListObjectsV2Result ¶
type ListObjectsV2Result struct { // The name of the bucket. Name *string `xml:"Name"` // The prefix contained in the returned object names. Prefix *string `xml:"Prefix"` // If the StartAfter parameter is specified in the request, the response contains the StartAfter parameter. StartAfter *string `xml:"StartAfter"` // The maximum number of returned objects in the response. MaxKeys int32 `xml:"MaxKeys"` // The character that is used to group objects by name. Delimiter *string `xml:"Delimiter"` // Indicates whether the returned results are truncated. // true indicates that not all results are returned this time. // false indicates that all results are returned this time. IsTruncated bool `xml:"IsTruncated"` // If the ContinuationToken parameter is specified in the request, the response contains the ContinuationToken parameter. ContinuationToken *string `xml:"ContinuationToken"` // The name of the object from which the next ListObjectsV2 (GetBucketV2) operation starts. // The NextContinuationToken value is used as the ContinuationToken value to query subsequent results. NextContinuationToken *string `xml:"NextContinuationToken"` // The encoding type of the content in the response. EncodingType *string `xml:"EncodingType"` // The container that stores the metadata of the returned objects. Contents []ObjectProperties `xml:"Contents"` // If the Delimiter parameter is specified in the request, the response contains the CommonPrefixes element. CommonPrefixes []CommonPrefix `xml:"CommonPrefixes"` // The number of objects returned for this request. If Delimiter is specified, KeyCount is the sum of the values of Key and CommonPrefixes. KeyCount int `xml:"KeyCount"` ResultCommon }
type ListPartsAPIClient ¶
type ListPartsAPIClient interface {
ListParts(ctx context.Context, request *ListPartsRequest, optFns ...func(*Options)) (*ListPartsResult, error)
}
type ListPartsPaginator ¶
type ListPartsPaginator struct {
// contains filtered or unexported fields
}
ListPartsPaginator is a paginator for ListParts
func NewListPartsPaginator ¶
func NewListPartsPaginator(c ListPartsAPIClient, request *ListPartsRequest, optFns ...func(*PaginatorOptions)) *ListPartsPaginator
func (*ListPartsPaginator) HasNext ¶
func (p *ListPartsPaginator) HasNext() bool
HasNext Returns true if there’s a next page.
func (*ListPartsPaginator) NextPage ¶
func (p *ListPartsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPartsResult, error)
NextPage retrieves the next ListParts page.
type ListPartsRequest ¶
type ListPartsRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The name of the object. Key *string `input:"path,key,required"` // The ID of the multipart upload task. UploadId *string `input:"query,uploadId,required"` // The encoding type of the content in the response. Valid value: url EncodingType *string `input:"query,encoding-type"` // The maximum number of parts that can be returned by OSS. // Default value: 1000. Maximum value: 1000. MaxParts int32 `input:"query,max-parts"` // The position from which the list starts. // All parts whose part numbers are greater than the value of this parameter are listed. PartNumberMarker int32 `input:"query,part-number-marker"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type ListPartsResult ¶
type ListPartsResult struct { // The method used to encode the object name in the response. // If encoding-type is specified in the request, values of those elements including // Delimiter, KeyMarker, Prefix, NextKeyMarker, and Key are encoded in the returned result. EncodingType *string `xml:"EncodingType"` // The name of the bucket. Bucket *string `xml:"Bucket"` // The name of the object that corresponds to the multipart upload task after which the list begins. Key *string `xml:"Key"` // The ID of the upload task. UploadId *string `xml:"UploadId"` // The position from which the list starts. // All parts whose part numbers are greater than the value of this parameter are listed. PartNumberMarker int32 `xml:"PartNumberMarker"` // The NextPartNumberMarker value that is used for the PartNumberMarker value in a subsequent // request when the response does not contain all required results. NextPartNumberMarker int32 `xml:"NextPartNumberMarker"` // he maximum number of parts in the response. MaxParts int32 `xml:"MaxParts"` // Indicates whether the list of parts returned in the response has been truncated. // true: Only part of the results are returned this time. // false: All results are returned. IsTruncated bool `xml:"IsTruncated"` // The storage class of the object. StorageClass *string `xml:"StorageClass"` // The encrypted data key. // The encrypted data key is a string encrypted by a customer master key and encoded in Base64. // Only available in client-side encryption ClientEncryptionKey *string `xml:"ClientEncryptionKey"` // The initial value that is randomly generated for data encryption. // The initial value is is a string encrypted by a customer master key and encoded in Base64. // Only available in client-side encryption ClientEncryptionStart *string `xml:"ClientEncryptionStart"` // The algorithm used to encrypt data. // Only available in client-side encryption ClientEncryptionCekAlg *string `xml:"ClientEncryptionCekAlg"` // The algorithm used to encrypt the data key. // Only available in client-side encryption ClientEncryptionWrapAlg *string `xml:"ClientEncryptionWrapAlg"` // The total size of the data to encrypt for multipart upload when init_multipart is called. // Only available in client-side encryption ClientEncryptionDataSize *int64 `xml:"ClientEncryptionDataSize"` // The size of each part to encrypt for multipart upload when init_multipart is called. // Only available in client-side encryption ClientEncryptionPartSize *int64 `xml:"ClientEncryptionPartSize"` Parts []Part `xml:"Part"` ResultCommon }
type LogPrinter ¶
type LogPrinter interface {
Print(...any)
}
A LogPrinter is a interface for the SDK to log messages to.
type LogPrinterFunc ¶
type LogPrinterFunc func(...any)
A LogPrinterFunc is a convenience type to wrap it so the LogPrinter interface can be used.
func (LogPrinterFunc) Print ¶
func (f LogPrinterFunc) Print(v ...any)
Print calls the wrapped function with the arguments provided
type Logger ¶
type Logger interface { Debugf(format string, v ...any) Infof(format string, v ...any) Warnf(format string, v ...any) Errorf(format string, v ...any) Level() int }
Logger interface to handle logging
type MultiBytesReader ¶
type MultiBytesReader struct {
// contains filtered or unexported fields
}
MultiBytesReader A Reader implements the io.Reader, io.Seeker interfaces by reading from multi byte slice.
func NewMultiBytesReader ¶
func NewMultiBytesReader(b [][]byte) *MultiBytesReader
NewReader returns a new Reader reading from b.
func (*MultiBytesReader) Len ¶
func (r *MultiBytesReader) Len() int
Len returns the number of bytes of the unread portion of the slice.
func (*MultiBytesReader) Read ¶
func (r *MultiBytesReader) Read(b []byte) (n int, err error)
Read implements the io.Reader interface.
func (*MultiBytesReader) Reset ¶
func (r *MultiBytesReader) Reset(b [][]byte)
Reset resets the Reader to be reading from b.
func (*MultiBytesReader) Seek ¶
func (r *MultiBytesReader) Seek(offset int64, whence int) (int64, error)
Seek implements the io.Seeker interface.
func (*MultiBytesReader) Size ¶
func (r *MultiBytesReader) Size() int64
Size returns the original length of the underlying byte slice.
type ObjectACLType ¶
type ObjectACLType string
ObjectACLType The access control list (ACL) of the object
const ( // ObjectACLPrivate Only the object owner is allowed to perform read and write operations on the object. // Other users cannot access the object. ObjectACLPrivate ObjectACLType = "private" // ObjectACLPublicRead Only the object owner can write data to the object. // Other users, including anonymous users, can only read the object. ObjectACLPublicRead ObjectACLType = "public-read" // ObjectACLPublicReadWrite All users, including anonymous users, can perform read and write operations on the object. ObjectACLPublicReadWrite ObjectACLType = "public-read-write" // ObjectACLDefault The ACL of the object is the same as that of the bucket in which the object is stored. ObjectACLDefault ObjectACLType = "default" )
Enum values for ObjectACLType
type ObjectDeleteMarkerProperties ¶
type ObjectDeleteMarkerProperties struct { // The name of the object. Key *string `xml:"Key"` // The version ID of the object. VersionId *string `xml:"VersionId"` // Indicates whether the version is the current version. IsLatest bool `xml:"IsLatest"` // The time when the returned objects were last modified. LastModified *time.Time `xml:"LastModified"` // The container that stores information about the bucket owner. Owner *Owner `xml:"Owner"` }
type ObjectMixProperties ¶
type ObjectMixProperties ObjectVersionProperties
func (ObjectMixProperties) IsDeleteMarker ¶
func (m ObjectMixProperties) IsDeleteMarker() bool
type ObjectProperties ¶
type ObjectProperties struct { // The name of the object. Key *string `xml:"Key"` // The type of the object. Valid values: Normal, Multipart and Appendable Type *string `xml:"Type"` // The size of the returned object. Unit: bytes. Size int64 `xml:"Size"` // The entity tag (ETag). An ETag is created when an object is created to identify the content of the object. ETag *string `xml:"ETag"` // The time when the returned objects were last modified. LastModified *time.Time `xml:"LastModified"` // The storage class of the object. StorageClass *string `xml:"StorageClass"` // The container that stores information about the bucket owner. Owner *Owner `xml:"Owner"` // The restoration status of the object. RestoreInfo *string `xml:"RestoreInfo"` }
type ObjectVersionProperties ¶
type ObjectVersionProperties struct { // The name of the object. Key *string `xml:"Key"` // The version ID of the object. VersionId *string `xml:"VersionId"` // Indicates whether the version is the current version. IsLatest bool `xml:"IsLatest"` // The time when the returned objects were last modified. LastModified *time.Time `xml:"LastModified"` // The type of the returned object. Type *string `xml:"Type"` // The size of the returned object. Unit: bytes. Size int64 `xml:"Size"` // The entity tag (ETag) that is generated when an object is created. ETags are used to identify the content of objects. ETag *string `xml:"ETag"` // The storage class of the object. StorageClass *string `xml:"StorageClass"` // The container that stores information about the bucket owner. Owner *Owner `xml:"Owner"` // The restoration status of the object. RestoreInfo *string `xml:"RestoreInfo"` }
type OpenFileAPIClient ¶
type OpenFileAPIClient interface { HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error) GetObject(ctx context.Context, request *GetObjectRequest, optFns ...func(*Options)) (*GetObjectResult, error) }
type OpenOptions ¶
type OperationError ¶
type OperationError struct {
// contains filtered or unexported fields
}
func (*OperationError) Error ¶
func (e *OperationError) Error() string
func (*OperationError) Operation ¶
func (e *OperationError) Operation() string
func (*OperationError) Unwrap ¶
func (e *OperationError) Unwrap() error
type OperationInput ¶
type OperationMetadata ¶
type OperationMetadata struct {
// contains filtered or unexported fields
}
func (*OperationMetadata) Add ¶
func (m *OperationMetadata) Add(key, value any)
func (OperationMetadata) Clone ¶
func (m OperationMetadata) Clone() OperationMetadata
func (OperationMetadata) Get ¶
func (m OperationMetadata) Get(key any) any
func (OperationMetadata) Has ¶
func (m OperationMetadata) Has(key any) bool
func (*OperationMetadata) Set ¶
func (m *OperationMetadata) Set(key, value any)
func (OperationMetadata) Values ¶
func (m OperationMetadata) Values(key any) []any
type OperationOutput ¶
type OperationOutput struct { Input *OperationInput Status string StatusCode int Headers http.Header Body io.ReadCloser OpMetadata OperationMetadata // contains filtered or unexported fields }
type Options ¶
type Options struct { Product string Region string Endpoint *url.URL RetryMaxAttempts *int Retryer retry.Retryer Signer signer.Signer CredentialsProvider credentials.CredentialsProvider HttpClient HTTPClient ResponseHandlers []func(*http.Response) error UrlStyle UrlStyleType FeatureFlags FeatureFlagsType OpReadWriteTimeout *time.Duration AuthMethod *AuthMethodType AdditionalHeaders []string }
type OutputSerializationSelect ¶
type OutputSerializationSelect struct { CsvBodyOutput *CSVSelectOutput `xml:"CSV"` JsonBodyOutput *JSONSelectOutput `xml:"JSON"` OutputRawData *bool `xml:"OutputRawData"` KeepAllColumns *bool `xml:"KeepAllColumns"` EnablePayloadCrc *bool `xml:"EnablePayloadCrc"` OutputHeader *bool `xml:"OutputHeader"` }
type PaginatorOptions ¶
type PaginatorOptions struct { // The maximum number of items in the response. Limit int32 }
type Part ¶
type Part struct { // The number that identifies a part. PartNumber int32 `xml:"PartNumber"` // The ETag value of the content of the uploaded part. ETag *string `xml:"ETag"` // The time when the part was uploaded. LastModified *time.Time `xml:"LastModified"` // The size of the uploaded parts. Size int64 `xml:"Size"` // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `xml:"HashCrc64ecma"` }
type PresignOptions ¶
type PresignResult ¶
type ProcessObjectRequest ¶
type ProcessObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // Image processing parameters Process *string `input:"x-oss-process,nop,required"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type ProcessObjectResult ¶
type ProcessObjectResult struct { Bucket string `json:"bucket"` FileSize int `json:"fileSize"` Object string `json:"object"` ProcessStatus string `json:"status"` ResultCommon }
type ProgressFunc ¶
type ProgressFunc func(increment, transferred, total int64)
type PutBucketAclRequest ¶
type PutBucketAclRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` // The access control list (ACL) of the object. Acl BucketACLType `input:"header,x-oss-acl,required"` RequestCommon }
type PutBucketAclResult ¶
type PutBucketAclResult struct {
ResultCommon
}
type PutBucketRequest ¶
type PutBucketRequest struct { // The name of the bucket to create. Bucket *string `input:"host,bucket,required"` // The access control list (ACL) of the bucket. Acl BucketACLType `input:"header,x-oss-acl"` // The ID of the resource group. ResourceGroupId *string `input:"header,x-oss-resource-group-id"` // The configuration information for the bucket. CreateBucketConfiguration *CreateBucketConfiguration `input:"body,CreateBucketConfiguration,xml"` RequestCommon }
type PutBucketRequestPaymentRequest ¶
type PutBucketRequestPaymentRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` // The request payment configuration information for the bucket. PaymentConfiguration *RequestPaymentConfiguration `input:"body,RequestPaymentConfiguration,xml,required"` RequestCommon }
type PutBucketRequestPaymentResult ¶
type PutBucketRequestPaymentResult struct {
ResultCommon
}
type PutBucketResult ¶
type PutBucketResult struct {
ResultCommon
}
type PutBucketVersioningRequest ¶
type PutBucketVersioningRequest struct { // The name of the bucket containing the objects Bucket *string `input:"host,bucket,required"` VersioningConfiguration *VersioningConfiguration `input:"body,VersioningConfiguration,xml,required"` RequestCommon }
type PutBucketVersioningResult ¶
type PutBucketVersioningResult struct {
ResultCommon
}
type PutObjectAclRequest ¶
type PutObjectAclRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The access control list (ACL) of the object. Acl ObjectACLType `input:"header,x-oss-object-acl,required"` // The version ID of the source object. VersionId *string `input:"query,versionId"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type PutObjectAclResult ¶
type PutObjectAclResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` ResultCommon }
type PutObjectRequest ¶
type PutObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The caching behavior of the web page when the object is downloaded. CacheControl *string `input:"header,Cache-Control"` // The method that is used to access the object. ContentDisposition *string `input:"header,Content-Disposition"` // The method that is used to encode the object. ContentEncoding *string `input:"header,Content-Encoding"` // The size of the data in the HTTP message body. Unit: bytes. ContentLength *int64 `input:"header,Content-Length"` // The MD5 hash of the object that you want to upload. ContentMD5 *string `input:"header,Content-MD5"` // A standard MIME type describing the format of the contents. ContentType *string `input:"header,Content-Type"` // The expiration time of the cache in UTC. Expires *string `input:"header,Expires"` // Specifies whether the object that is uploaded by calling the PutObject operation // overwrites an existing object that has the same name. Valid values: true and false ForbidOverwrite *string `input:"header,x-oss-forbid-overwrite"` // The encryption method on the server side when an object is created. // Valid values: AES256 and KMS ServerSideEncryption *string `input:"header,x-oss-server-side-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). // This header is valid only when the x-oss-server-side-encryption header is set to KMS. ServerSideDataEncryption *string `input:"header,x-oss-server-side-data-encryption"` // The ID of the customer master key (CMK) that is managed by Key Management Service (KMS). SSEKMSKeyId *string `input:"header,x-oss-server-side-encryption-key-id"` // The access control list (ACL) of the object. Acl ObjectACLType `input:"header,x-oss-object-acl"` // The storage class of the object. StorageClass StorageClassType `input:"header,x-oss-storage-class"` // The metadata of the object that you want to upload. Metadata map[string]string `input:"header,x-oss-meta-,usermeta"` // The tags that are specified for the object by using a key-value pair. // You can specify multiple tags for an object. Example: TagA=A&TagB=B. Tagging *string `input:"header,x-oss-tagging"` // A callback parameter is a Base64-encoded string that contains multiple fields in the JSON format. Callback *string `input:"header,x-oss-callback"` // Configure custom parameters by using the callback-var parameter. CallbackVar *string `input:"header,x-oss-callback-var"` // Specify the speed limit value. The speed limit value ranges from 245760 to 838860800, with a unit of bit/s. TrafficLimit int64 `input:"header,x-oss-traffic-limit"` // Object data. Body io.Reader `input:"body,nop"` // Progress callback function ProgressFn ProgressFunc // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type PutObjectResult ¶
type PutObjectResult struct { // Content-Md5 for the uploaded object. ContentMD5 *string `output:"header,Content-MD5"` // Entity tag for the uploaded object. ETag *string `output:"header,ETag"` // The 64-bit CRC value of the object. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` // Version of the object. VersionId *string `output:"header,x-oss-version-id"` CallbackResult map[string]any ResultCommon }
type PutObjectTaggingRequest ¶
type PutObjectTaggingRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // Version of the object. VersionId *string `input:"query,versionId"` Tagging *Tagging `input:"body,Tagging,xml,required"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type PutObjectTaggingResult ¶
type PutObjectTaggingResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` ResultCommon }
type PutSymlinkRequest ¶
type PutSymlinkRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The destination object to which the symbolic link points. Target *string `input:"header,x-oss-symlink-target,required"` // Specifies whether the object that is uploaded by calling the PutObject operation // overwrites an existing object that has the same name. Valid values: true and false ForbidOverwrite *string `input:"header,x-oss-forbid-overwrite"` // The ACL of the object. Default value: default. Acl ObjectACLType `input:"header,x-oss-object-acl"` // The storage class of the object. StorageClass StorageClassType `input:"header,x-oss-storage-class"` // The metadata of the object that you want to symlink. Metadata map[string]string `input:"header,x-oss-meta-,usermeta"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type PutSymlinkResult ¶
type PutSymlinkResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` ResultCommon }
type RangeReader ¶
type RangeReader struct {
// contains filtered or unexported fields
}
func NewRangeReader ¶
func NewRangeReader(ctx context.Context, rangeGet ReaderRangeGetFn, httpRange *HTTPRange, etag string) (*RangeReader, error)
NewRangeReader returns a reader that will read from the Reader returued by getter from the given offset. The etag is used to identify the content of the object. If not set, the first ETag returned value will be used instead.
func (*RangeReader) Close ¶
func (r *RangeReader) Close() (err error)
func (*RangeReader) Offset ¶
func (r *RangeReader) Offset() int64
type ReadFlagInfo ¶
type ReadOnlyFile ¶
type ReadOnlyFile struct {
// contains filtered or unexported fields
}
func NewReadOnlyFile ¶
func NewReadOnlyFile(ctx context.Context, c OpenFileAPIClient, bucket string, key string, optFns ...func(*OpenOptions)) (*ReadOnlyFile, error)
NewReadOnlyFile OpenFile opens the named file for reading. If successful, methods on the returned file can be used for reading.
func (*ReadOnlyFile) Read ¶
func (f *ReadOnlyFile) Read(p []byte) (bytesRead int, err error)
Read reads up to len(b) bytes from the File and stores them in b. It returns the number of bytes read and any error encountered. At end of file, Read returns 0, io.EOF.
func (*ReadOnlyFile) Seek ¶
func (f *ReadOnlyFile) Seek(offset int64, whence int) (int64, error)
Seek sets the offset for the next Read or Write on file to offset, interpreted according to whence: 0 means relative to the origin of the file, 1 means relative to the current offset, and 2 means relative to the end. It returns the new offset and an error.
type ReadSeekerNopClose ¶
type ReadSeekerNopClose struct {
// contains filtered or unexported fields
}
func ReadSeekNopCloser ¶
func ReadSeekNopCloser(r io.Reader) ReadSeekerNopClose
func (ReadSeekerNopClose) Close ¶
func (r ReadSeekerNopClose) Close() error
func (ReadSeekerNopClose) GetLen ¶
func (r ReadSeekerNopClose) GetLen() (int64, error)
func (ReadSeekerNopClose) HasLen ¶
func (r ReadSeekerNopClose) HasLen() (int, bool)
func (ReadSeekerNopClose) IsSeeker ¶
func (r ReadSeekerNopClose) IsSeeker() bool
type ReaderRangeGetFn ¶
type ReaderRangeGetFn func(context.Context, HTTPRange) (output *ReaderRangeGetOutput, err error)
type ReaderRangeGetOutput ¶
type ReaderWrapper ¶
type ReaderWrapper struct { Body io.ReadCloser Version byte FrameType int32 PayloadLength int32 HeaderCheckSum uint32 Offset uint64 Data string ClientCRC32 uint32 ServerCRC32 uint32 WriterForCheckCrc32 hash.Hash32 HTTPStatusCode int32 TotalScanned int64 Status int32 SplitsCount int32 RowsCount int64 ColumnsCount int32 ErrorMsg string PayloadChecksum uint32 ReadFlagInfo Finish bool }
ReaderWrapper defines HTTP response from OSS SelectObject
type RequestBodyTracker ¶
type RequestCommon ¶
type RequestCommon struct { Headers map[string]string Parameters map[string]string Payload io.Reader }
func (*RequestCommon) GetCommonFileds ¶
type RequestCommonInterface ¶
type RestoreObjectRequest ¶
type RestoreObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,bucket,required"` // The name of the object. Key *string `input:"path,key,required"` // The version ID of the source object. VersionId *string `input:"query,versionId"` // The container that stores information about the RestoreObject request. RestoreRequest *RestoreRequest `input:"body,RestoreRequest,xml"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type RestoreObjectResult ¶
type RestoreObjectResult struct { // Version of the object. VersionId *string `output:"header,x-oss-version-id"` // The restoration priority. // This header is displayed only for the Cold Archive or Deep Cold Archive object in the restored state. RestorePriority *string `output:"header,x-oss-object-restore-priority"` ResultCommon }
type RestoreRequest ¶
type ResultCommon ¶
type ResultCommon struct { Status string StatusCode int Headers http.Header OpMetadata OperationMetadata }
func (*ResultCommon) CopyIn ¶
func (r *ResultCommon) CopyIn(status string, statusCode int, headers http.Header, meta OperationMetadata)
type ResultCommonInterface ¶
type ResultCommonInterface interface {
CopyIn(status string, statusCode int, headers http.Header, meta OperationMetadata)
}
type SSERule ¶
type SSERule struct { // The customer master key (CMK) ID in use. A valid value is returned only if you set SSEAlgorithm to KMS // and specify the CMK ID. In other cases, an empty value is returned. KMSMasterKeyID *string `xml:"KMSMasterKeyID"` // The server-side encryption method that is used by default. SSEAlgorithm *string `xml:"SSEAlgorithm"` // Object's encryption algorithm. If this element is not included in the response, // it indicates that the object is using the AES256 encryption algorithm. // This option is only valid if the SSEAlgorithm value is KMS. KMSDataEncryption *string `xml:"KMSDataEncryption"` }
type SelectObjectRequest ¶
type SelectObjectRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The name of the object. Key *string `input:"path,key,required"` SelectRequest *SelectRequest `input:"nop,SelectRequest,required"` RequestCommon }
type SelectObjectResult ¶
type SelectObjectResult struct { Body io.ReadCloser ResultCommon }
type SelectOptions ¶
type SelectRequest ¶
type SelectRequest struct { Expression *string `xml:"Expression"` InputSerializationSelect InputSerializationSelect `xml:"InputSerialization"` OutputSerializationSelect OutputSerializationSelect `xml:"OutputSerialization"` SelectOptions *SelectOptions `xml:"Options"` }
type SerializationError ¶
type SerializationError struct {
Err error
}
func (*SerializationError) Error ¶
func (e *SerializationError) Error() string
func (*SerializationError) Unwrap ¶
func (e *SerializationError) Unwrap() error
type ServiceError ¶
type ServiceError struct { XMLName xml.Name `xml:"Error"` Code string `xml:"Code"` Message string `xml:"Message"` RequestID string `xml:"RequestId"` EC string `xml:"EC"` StatusCode int Snapshot []byte Timestamp time.Time RequestTarget string Headers http.Header }
func (*ServiceError) Error ¶
func (e *ServiceError) Error() string
func (*ServiceError) ErrorCode ¶
func (e *ServiceError) ErrorCode() string
func (*ServiceError) HttpStatusCode ¶
func (e *ServiceError) HttpStatusCode() int
type SignatureVersionType ¶
type SignatureVersionType int
const ( SignatureVersionV1 SignatureVersionType = iota SignatureVersionV4 )
func (SignatureVersionType) String ¶
func (f SignatureVersionType) String() string
type StorageClassType ¶
type StorageClassType string
StorageClassType The storage class of the bucket
const ( // StorageClassStandard Standard provides highly reliable, highly available, // and high-performance object storage for data that is frequently accessed. StorageClassStandard StorageClassType = "Standard" // StorageClassIA IA provides highly durable storage at lower prices compared with Standard. // IA has a minimum billable size of 64 KB and a minimum billable storage duration of 30 days. StorageClassIA StorageClassType = "IA" // StorageClassArchive Archive provides high-durability storage at lower prices compared with Standard and IA. // Archive has a minimum billable size of 64 KB and a minimum billable storage duration of 60 days. StorageClassArchive StorageClassType = "Archive" // StorageClassColdArchive Cold Archive provides highly durable storage at lower prices compared with Archive. // Cold Archive has a minimum billable size of 64 KB and a minimum billable storage duration of 180 days. StorageClassColdArchive StorageClassType = "ColdArchive" // StorageClassDeepColdArchive Deep Cold Archive provides highly durable storage at lower prices compared with Cold Archive. // Deep Cold Archive has a minimum billable size of 64 KB and a minimum billable storage duration of 180 days. StorageClassDeepColdArchive StorageClassType = "DeepColdArchive" )
Enum values for StorageClassType
type UploadAPIClient ¶
type UploadAPIClient interface { HeadObject(ctx context.Context, request *HeadObjectRequest, optFns ...func(*Options)) (*HeadObjectResult, error) PutObject(ctx context.Context, request *PutObjectRequest, optFns ...func(*Options)) (*PutObjectResult, error) InitiateMultipartUpload(ctx context.Context, request *InitiateMultipartUploadRequest, optFns ...func(*Options)) (*InitiateMultipartUploadResult, error) UploadPart(ctx context.Context, request *UploadPartRequest, optFns ...func(*Options)) (*UploadPartResult, error) CompleteMultipartUpload(ctx context.Context, request *CompleteMultipartUploadRequest, optFns ...func(*Options)) (*CompleteMultipartUploadResult, error) AbortMultipartUpload(ctx context.Context, request *AbortMultipartUploadRequest, optFns ...func(*Options)) (*AbortMultipartUploadResult, error) ListParts(ctx context.Context, request *ListPartsRequest, optFns ...func(*Options)) (*ListPartsResult, error) }
type UploadError ¶
func (*UploadError) Error ¶
func (m *UploadError) Error() string
func (*UploadError) Unwrap ¶
func (m *UploadError) Unwrap() error
type UploadPart ¶
type UploadPartCopyRequest ¶
type UploadPartCopyRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The name of the object. Key *string `input:"path,key,required"` // Each uploaded part is identified by a number. // Value: 1-10000 //The size limit of a single part is between 100 KB and 5 GB. PartNumber int32 `input:"query,partNumber,required"` // The ID of the multipart upload task. UploadId *string `input:"query,uploadId,required"` // The name of the source bucket. SourceBucket *string `input:"nop,bucket"` // The path of the source object. SourceKey *string `input:"nop,key,required"` // The version ID of the source object. SourceVersionId *string `input:"nop,versionId"` // The range of bytes to copy data from the source object. Range *string `input:"header,x-oss-copy-source-range"` // The copy operation condition. If the ETag value of the source object is // the same as the ETag value provided by the user, OSS copies data. Otherwise, // OSS returns 412 Precondition Failed. IfMatch *string `input:"header,x-oss-copy-source-if-match"` // The object transfer condition. If the input ETag value does not match the ETag value of the object // the system transfers the object normally and returns 200 OK. Otherwise, OSS returns 304 Not Modified. IfNoneMatch *string `input:"header,x-oss-copy-source-if-none-match"` // The object transfer condition. If the specified time is earlier than the actual modified time of the object, // the system transfers the object normally and returns 200 OK. Otherwise, OSS returns 304 Not Modified. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfModifiedSince *string `input:"header,x-oss-copy-source-if-modified-since"` // The object transfer condition. If the specified time is the same as or later than the actual modified time of the object, // OSS transfers the object normally and returns 200 OK. Otherwise, OSS returns 412 Precondition Failed. // The time must be in GMT. Example: Fri, 13 Nov 2015 14:47:53 GMT. IfUnmodifiedSince *string `input:"header,x-oss-copy-source-if-unmodified-since"` // Specify the speed limit value. The speed limit value ranges from 245760 to 838860800, with a unit of bit/s. TrafficLimit int64 `input:"header,x-oss-traffic-limit"` // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type UploadPartCopyResult ¶
type UploadPartCopyResult struct { // The time when the returned objects were last modified. LastModified *time.Time `xml:"LastModified"` // Entity tag for the uploaded part. ETag *string `xml:"ETag"` // The version ID of the source object. VersionId *string `output:"header,x-oss-copy-source-version-id"` ResultCommon }
type UploadPartRequest ¶
type UploadPartRequest struct { // The name of the bucket. Bucket *string `input:"host,uploadId,required"` // The name of the object. Key *string `input:"path,key,required"` // Each uploaded part is identified by a number. // Value: 1-10000 //The size limit of a single part is between 100 KB and 5 GB. PartNumber int32 `input:"query,partNumber,required"` // The ID of the multipart upload task. UploadId *string `input:"query,uploadId,required"` // The MD5 hash of the object that you want to upload. ContentMD5 *string `input:"header,Content-MD5"` // Specify the speed limit value. The speed limit value ranges from 245760 to 838860800, with a unit of bit/s. TrafficLimit int64 `input:"header,x-oss-traffic-limit"` // Object data. Body io.Reader `input:"body,nop"` // Progress callback function ProgressFn ProgressFunc // The size of the data in the HTTP message body. Unit: bytes. ContentLength *int64 `input:"header,Content-Length"` // The encryption context for multipart upload when using client side encryption, only valid in EncryptionClient CSEMultiPartContext *EncryptionMultiPartContext // To indicate that the requester is aware that the request and data download will incur costs RequestPayer *string `input:"header,x-oss-request-payer"` RequestCommon }
type UploadPartResult ¶
type UploadPartResult struct { // Entity tag for the uploaded part. ETag *string `output:"header,ETag"` // The MD5 hash of the part that you want to upload. ContentMD5 *string `output:"header,Content-MD5"` // The 64-bit CRC value of the part. // This value is calculated based on the ECMA-182 standard. HashCRC64 *string `output:"header,x-oss-hash-crc64ecma"` ResultCommon }
type UploadParts ¶
type UploadParts []UploadPart
func (UploadParts) Len ¶
func (slice UploadParts) Len() int
func (UploadParts) Less ¶
func (slice UploadParts) Less(i, j int) bool
func (UploadParts) Swap ¶
func (slice UploadParts) Swap(i, j int)
type UploadResult ¶
type UploadResult struct { UploadId *string ETag *string VersionId *string HashCRC64 *string ResultCommon }
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
func NewUploader ¶
func NewUploader(c UploadAPIClient, optFns ...func(*UploaderOptions)) *Uploader
NewUploader creates a new Uploader instance to upload objects. Pass In additional functional options to customize the uploader's behavior.
func (*Uploader) UploadFile ¶
func (u *Uploader) UploadFile(ctx context.Context, request *PutObjectRequest, filePath string, optFns ...func(*UploaderOptions)) (*UploadResult, error)
func (*Uploader) UploadFrom ¶
func (u *Uploader) UploadFrom(ctx context.Context, request *PutObjectRequest, body io.Reader, optFns ...func(*UploaderOptions)) (*UploadResult, error)
type UploaderOptions ¶
type UrlStyleType ¶
type UrlStyleType int
const ( UrlStyleVirtualHosted UrlStyleType = iota UrlStylePath UrlStyleCName )
func (UrlStyleType) String ¶
func (f UrlStyleType) String() string
type VersioningConfiguration ¶
type VersioningConfiguration struct { // The versioning state of the bucket. Valid values: Enabled,Suspended Status VersioningStatusType `xml:"Status"` }
type VersioningStatusType ¶
type VersioningStatusType string
VersioningStatusType bucket versioning status
const ( // VersionEnabled Versioning Status definition: Enabled VersionEnabled VersioningStatusType = "Enabled" // VersionSuspended Versioning Status definition: Suspended VersionSuspended VersioningStatusType = "Suspended" )
type XmlChildren ¶
type XmlDecoderLite ¶
type XmlDecoderLite struct {
// contains filtered or unexported fields
}
func NewXmlDecoderLite ¶
func NewXmlDecoderLite(r io.Reader) *XmlDecoderLite
func (*XmlDecoderLite) Decode ¶
func (dec *XmlDecoderLite) Decode(root *XmlNode) error
Source Files
¶
- api_op_bucket.go
- api_op_common.go
- api_op_object.go
- api_op_select_object.go
- api_op_service.go
- checkpoint.go
- client.go
- client_extension.go
- client_paginators.go
- client_presign.go
- config.go
- copier.go
- defaults.go
- downloader.go
- encryption_client.go
- endpoints.go
- enums.go
- errors.go
- filelike.go
- from_ptr.go
- io_utils.go
- limiter.go
- logger.go
- progress.go
- to_ptr.go
- types.go
- uploader.go
- utils.go
- utils_copy.go
- utils_crc.go
- utils_mime.go
- utils_pool.go
- validation.go
- version.go
- xml_utils.go