oss

package
v3.0.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package oss implements functions for access oss service. It has two main struct Client and Bucket.

Index

Constants

View Source
const (
	LogOff = iota
	Error
	Warn
	Info
	Debug
)

Define the level of the output log

View Source
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"
	HTTPHeaderDate                      = "Date"
	HTTPHeaderEtag                      = "ETag"
	HTTPHeaderExpires                   = "Expires"
	HTTPHeaderHost                      = "Host"
	HTTPHeaderLastModified              = "Last-Modified"
	HTTPHeaderRange                     = "Range"
	HTTPHeaderLocation                  = "Location"
	HTTPHeaderOrigin                    = "Origin"
	HTTPHeaderServer                    = "Server"
	HTTPHeaderUserAgent                 = "User-Agent"
	HTTPHeaderIfModifiedSince           = "If-Modified-Since"
	HTTPHeaderIfUnmodifiedSince         = "If-Unmodified-Since"
	HTTPHeaderIfMatch                   = "If-Match"
	HTTPHeaderIfNoneMatch               = "If-None-Match"
	HTTPHeaderACReqMethod               = "Access-Control-Request-Method"
	HTTPHeaderACReqHeaders              = "Access-Control-Request-Headers"

	HTTPHeaderOssACL                         = "X-Oss-Acl"
	HTTPHeaderOssMetaPrefix                  = "X-Oss-Meta-"
	HTTPHeaderOssObjectACL                   = "X-Oss-Object-Acl"
	HTTPHeaderOssSecurityToken               = "X-Oss-Security-Token"
	HTTPHeaderOssServerSideEncryption        = "X-Oss-Server-Side-Encryption"
	HTTPHeaderOssServerSideEncryptionKeyID   = "X-Oss-Server-Side-Encryption-Key-Id"
	HTTPHeaderOssServerSideDataEncryption    = "X-Oss-Server-Side-Data-Encryption"
	HTTPHeaderSSECAlgorithm                  = "X-Oss-Server-Side-Encryption-Customer-Algorithm"
	HTTPHeaderSSECKey                        = "X-Oss-Server-Side-Encryption-Customer-Key"
	HTTPHeaderSSECKeyMd5                     = "X-Oss-Server-Side-Encryption-Customer-Key-MD5"
	HTTPHeaderOssCopySource                  = "X-Oss-Copy-Source"
	HTTPHeaderOssCopySourceRange             = "X-Oss-Copy-Source-Range"
	HTTPHeaderOssCopySourceIfMatch           = "X-Oss-Copy-Source-If-Match"
	HTTPHeaderOssCopySourceIfNoneMatch       = "X-Oss-Copy-Source-If-None-Match"
	HTTPHeaderOssCopySourceIfModifiedSince   = "X-Oss-Copy-Source-If-Modified-Since"
	HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
	HTTPHeaderOssMetadataDirective           = "X-Oss-Metadata-Directive"
	HTTPHeaderOssNextAppendPosition          = "X-Oss-Next-Append-Position"
	HTTPHeaderOssRequestID                   = "X-Oss-Request-Id"
	HTTPHeaderOssCRC64                       = "X-Oss-Hash-Crc64ecma"
	HTTPHeaderOssSymlinkTarget               = "X-Oss-Symlink-Target"
	HTTPHeaderOssStorageClass                = "X-Oss-Storage-Class"
	HTTPHeaderOssCallback                    = "X-Oss-Callback"
	HTTPHeaderOssCallbackVar                 = "X-Oss-Callback-Var"
	HTTPHeaderOssRequester                   = "X-Oss-Request-Payer"
	HTTPHeaderOssTagging                     = "X-Oss-Tagging"
	HTTPHeaderOssTaggingDirective            = "X-Oss-Tagging-Directive"
	HTTPHeaderOssTrafficLimit                = "X-Oss-Traffic-Limit"
	HTTPHeaderOssForbidOverWrite             = "X-Oss-Forbid-Overwrite"
	HTTPHeaderOssRangeBehavior               = "X-Oss-Range-Behavior"
	HTTPHeaderOssTaskID                      = "X-Oss-Task-Id"
	HTTPHeaderOssHashCtx                     = "X-Oss-Hash-Ctx"
	HTTPHeaderOssMd5Ctx                      = "X-Oss-Md5-Ctx"
	HTTPHeaderAllowSameActionOverLap         = "X-Oss-Allow-Same-Action-Overlap"
	HttpHeaderOssDate                        = "X-Oss-Date"
	HttpHeaderOssContentSha256               = "X-Oss-Content-Sha256"
	HttpHeaderOssNotification                = "X-Oss-Notification"
	HTTPHeaderOssEc                          = "X-Oss-Ec"
	HTTPHeaderOssErr                         = "X-Oss-Err"
)

HTTP headers

View Source
const (
	HTTPParamExpires       = "Expires"
	HTTPParamAccessKeyID   = "OSSAccessKeyId"
	HTTPParamSignature     = "Signature"
	HTTPParamSecurityToken = "security-token"
	HTTPParamPlaylistName  = "playlistName"

	HTTPParamSignatureVersion    = "x-oss-signature-version"
	HTTPParamExpiresV2           = "x-oss-expires"
	HTTPParamAccessKeyIDV2       = "x-oss-access-key-id"
	HTTPParamSignatureV2         = "x-oss-signature"
	HTTPParamAdditionalHeadersV2 = "x-oss-additional-headers"
	HTTPParamCredential          = "x-oss-credential"
	HTTPParamDate                = "x-oss-date"
	HTTPParamOssSecurityToken    = "x-oss-security-token"
)

HTTP Param

View Source
const (
	MaxPartSize = 5 * 1024 * 1024 * 1024 // Max part size, 5GB
	MinPartSize = 100 * 1024             // Min part size, 100KB

	FilePermMode = os.FileMode(0664) // Default file permission

	TempFilePrefix = "oss-go-temp-" // Temp file prefix
	TempFileSuffix = ".temp"        // Temp file suffix

	CheckpointFileSuffix = ".cp" // Checkpoint file suffix

	NullVersion = "null"

	DefaultContentSha256 = "UNSIGNED-PAYLOAD" // for v4 signature

	Version = "v3.0.2" // Go SDK version
)

Other constants

View Source
const (
	DataFrameType        = 8388609
	ContinuousFrameType  = 8388612
	EndFrameType         = 8388613
	MetaEndFrameCSVType  = 8388614
	MetaEndFrameJSONType = 8388615
)

FrameType

Variables

View Source
var CrcTable = func() *crc64.Table {
	return crc64.MakeTable(crc64.ECMA)
}

CrcTable returns the table constructed from the specified polynomial

View Source
var LogTag = []string{"[error]", "[warn]", "[info]", "[debug]"}

LogTag Tag for each level of log

Functions

func AdjustRange

func AdjustRange(ur *UnpackedRange, size int64) (start, end int64)

AdjustRange returns adjusted range, adjust the range according to the length of the file

func CRC64Combine

func CRC64Combine(crc1 uint64, crc2 uint64, len2 uint64) uint64

CRC64Combine combines CRC64

func CheckBucketName

func CheckBucketName(bucketName string) error

func CheckCRC

func CheckCRC(resp *Response, operation string) error

func CheckCallbackResp

func CheckCallbackResp(resp *Response) error

CheckCallbackResp return error if the given response code is not 200

func CheckDownloadCRC

func CheckDownloadCRC(clientCRC, serverCRC uint64) error

func CheckObjectName

func CheckObjectName(objectName string) error

func CheckObjectNameEx

func CheckObjectNameEx(objectName string, strict bool) error

func CheckRespCode

func CheckRespCode(respCode int, allowed []int) error

CheckRespCode returns UnexpectedStatusError if the given response code is not one of the allowed status codes; otherwise nil.

func ConvertEmptyValueToNil

func ConvertEmptyValueToNil(params map[string]interface{}, keys []string)

func EscapeLFString

func EscapeLFString(str string) string

func EscapeXml

func EscapeXml(s string) string

EscapeString writes to p the properly escaped XML equivalent of the plain text data s.

func FindOption

func FindOption(options []Option, param string, defaultVal interface{}) (interface{}, error)

func GetCallbackBody

func GetCallbackBody(options []Option, resp *Response, callbackSet bool) error

func GetCopySrcVersionId

func GetCopySrcVersionId(header http.Header) string

func GetDeleteMark

func GetDeleteMark(header http.Header) bool

func GetNowGMT

func GetNowGMT() string

GetNowGMT gets the current time in GMT format.

func GetNowNanoSec

func GetNowNanoSec() int64

GetNowNanoSec returns t as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC. The result is undefined if the Unix time in nanoseconds cannot be represented by an int64. Note that this means the result of calling UnixNano on the zero Time is undefined. gets the current time in Unix time, in nanoseconds.

func GetNowSec

func GetNowSec() int64

GetNowSec returns Unix time, the number of seconds elapsed since January 1, 1970 UTC. gets the current time in Unix time, in seconds.

func GetPartEnd

func GetPartEnd(begin int64, total int64, per int64) int64

GetPartEnd calculates the end position

func GetQosDelayTime

func GetQosDelayTime(header http.Header) string

func GetRangeString

func GetRangeString(unpackRange UnpackedRange) string

func GetRawParams

func GetRawParams(options []Option) (map[string]interface{}, error)

func GetReaderLen

func GetReaderLen(reader io.Reader) (int64, error)

func GetRequestId

func GetRequestId(header http.Header) string

func GetVersionId

func GetVersionId(header http.Header) string

func InvalidRangeError

func InvalidRangeError(r string) error

InvalidRangeError returns invalid range error

func IsOptionSet

func IsOptionSet(options []Option, option string) (bool, interface{}, error)

func LimitReadCloser

func LimitReadCloser(r io.Reader, n int64) io.Reader

func NewCRC

func NewCRC(tab *crc64.Table, init uint64) hash.Hash64

NewCRC creates a new hash.Hash64 computing the CRC64 checksum using the polynomial represented by the Table.

func TeeReader

func TeeReader(reader io.Reader, writer io.Writer, totalBytes int64, listener ProgressListener, tracker *readerTracker) io.ReadCloser

TeeReader 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 TypeByExtension

func TypeByExtension(filePath string) string

TypeByExtension returns the MIME type associated with the file extension ext. gets the file's MIME type for HTTP header Content-Type

Types

type ACLType

type ACLType string

ACLType bucket/object ACL

const (
	// ACLPrivate definition : private read and write
	ACLPrivate ACLType = "private"

	// ACLPublicRead definition : public read and private write
	ACLPublicRead ACLType = "public-read"

	// ACLPublicReadWrite definition : public read and public write
	ACLPublicReadWrite ACLType = "public-read-write"

	// ACLDefault Object. It's only applicable for object.
	ACLDefault ACLType = "default"
)

type AlgorithmType

type AlgorithmType string

AlgorithmType specifying the server side encryption algorithm name

const (
	KMSAlgorithm AlgorithmType = "KMS"
	AESAlgorithm AlgorithmType = "AES256"
	SM4Algorithm AlgorithmType = "SM4"
)

type AppendObjectRequest

type AppendObjectRequest struct {
	ObjectKey string
	Reader    io.Reader
	Position  int64
}

AppendObjectRequest is the requtest of DoAppendObject

type AppendObjectResult

type AppendObjectResult struct {
	NextPosition int64
	CRC          uint64
}

AppendObjectResult is the result of DoAppendObject

type AsynFetchTaskInfo

type AsynFetchTaskInfo struct {
	XMLName  xml.Name      `xml:"AsyncFetchTaskInfo"`
	TaskId   string        `xml:"TaskId,omitempty"`
	State    string        `xml:"State,omitempty"`
	ErrorMsg string        `xml:"ErrorMsg,omitempty"`
	TaskInfo AsyncTaskInfo `xml:"TaskInfo,omitempty"`
}

AsynFetchTaskInfo for GetBucketAsyncFetchTask result

type AsyncFetchTaskConfiguration

type AsyncFetchTaskConfiguration struct {
	XMLName       xml.Name `xml:"AsyncFetchTaskConfiguration"`
	Url           string   `xml:"Url,omitempty"`
	Object        string   `xml:"Object,omitempty"`
	Host          string   `xml:"Host,omitempty"`
	ContentMD5    string   `xml:"ContentMD5,omitempty"`
	Callback      string   `xml:"Callback,omitempty"`
	StorageClass  string   `xml:"StorageClass,omitempty"`
	IgnoreSameKey bool     `xml:"IgnoreSameKey"`
}

AsyncFetchTaskConfiguration for SetBucketAsyncFetchTask

type AsyncFetchTaskResult

type AsyncFetchTaskResult struct {
	XMLName xml.Name `xml:"AsyncFetchTaskResult"`
	TaskId  string   `xml:"TaskId,omitempty"`
}

AsyncFetchTaskResult for SetBucketAsyncFetchTask result

type AsyncProcessObjectResult

type AsyncProcessObjectResult struct {
	EventId   string `json:"EventId"`
	RequestId string `json:"RequestId"`
	TaskId    string `json:"TaskId"`
}

AsyncProcessObjectResult defines result object of AsyncProcessObject

type AsyncTaskInfo

type AsyncTaskInfo struct {
	XMLName       xml.Name `xml:"TaskInfo"`
	Url           string   `xml:"Url,omitempty"`
	Object        string   `xml:"Object,omitempty"`
	Host          string   `xml:"Host,omitempty"`
	ContentMD5    string   `xml:"ContentMD5,omitempty"`
	Callback      string   `xml:"Callback,omitempty"`
	StorageClass  string   `xml:"StorageClass,omitempty"`
	IgnoreSameKey bool     `xml:"IgnoreSameKey"`
}

AsyncTaskInfo for async task information

type AuthVersionType

type AuthVersionType string

AuthVersion the version of auth

const (
	// AuthV1 v1
	AuthV1 AuthVersionType = "v1"
	// AuthV2 v2
	AuthV2 AuthVersionType = "v2"
	// AuthV4 v4
	AuthV4 AuthVersionType = "v4"
)

type Bucket

type Bucket struct {
	Client     Client
	BucketName string
}

Bucket implements the operations of object.

func (Bucket) AbortMultipartUpload

func (bucket Bucket) AbortMultipartUpload(imur InitiateMultipartUploadResult, options ...Option) error

AbortMultipartUpload aborts the multipart upload.

imur the return value of InitiateMultipartUpload.

error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) AppendObject

func (bucket Bucket) AppendObject(objectKey string, reader io.Reader, appendPosition int64, options ...Option) (int64, error)

AppendObject uploads the data in the way of appending an existing or new object.

AppendObject the parameter appendPosition specifies which postion (in the target object) to append. For the first append (to a non-existing file), the appendPosition should be 0. The appendPosition in the subsequent calls will be the current object length. For example, the first appendObject's appendPosition is 0 and it uploaded 65536 bytes data, then the second call's position is 65536. The response header x-oss-next-append-position after each successful request also specifies the next call's append position (so the caller need not to maintain this information).

objectKey the target object to append to. reader io.Reader. The read instance for reading the data to append. appendPosition the start position to append. destObjectProperties the options for the first appending, such as CacheControl, ContentDisposition, ContentEncoding,

Expires, ServerSideEncryption, ObjectACL.

int64 the next append position, it's valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Bucket) AsyncProcessObject

func (bucket Bucket) AsyncProcessObject(objectKey string, asyncProcess string, options ...Option) (AsyncProcessObjectResult, error)

AsyncProcessObject apply async process on the specified image file.

The supported process includes resize, rotate, crop, watermark, format, udf, customized style, etc.

objectKey object key to process. asyncProcess process string, such as "image/resize,w_100|sys/saveas,o_dGVzdC5qcGc,b_dGVzdA"

error it's nil if no error, otherwise it's an error object.

func (Bucket) CompleteMultipartUpload

func (bucket Bucket) CompleteMultipartUpload(imur InitiateMultipartUploadResult,
	parts []UploadPart, options ...Option) (CompleteMultipartUploadResult, error)

CompleteMultipartUpload completes the multipart upload.

imur the return value of InitiateMultipartUpload. parts the array of return value of UploadPart/UploadPartFromFile/UploadPartCopy.

CompleteMultipartUploadResponse the return value when the call succeeds. Only valid when the error is nil. error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) CopyFile

func (bucket Bucket) CopyFile(srcBucketName, srcObjectKey, destObjectKey string, partSize int64, options ...Option) error

CopyFile is multipart copy object

srcBucketName source bucket name srcObjectKey source object name destObjectKey target object name in the form of bucketname.objectkey partSize the part size in byte. options object's contraints. Check out function InitiateMultipartUpload.

error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) CopyObject

func (bucket Bucket) CopyObject(srcObjectKey, destObjectKey string, options ...Option) (CopyObjectResult, error)

CopyObject copies the object inside the bucket.

srcObjectKey the source object to copy. destObjectKey the target object to copy. options options for copying an object. You can specify the conditions of copy. The valid conditions are CopySourceIfMatch,

CopySourceIfNoneMatch, CopySourceIfModifiedSince, CopySourceIfUnmodifiedSince, MetadataDirective.
Also you can specify the target object's attributes, such as CacheControl, ContentDisposition, ContentEncoding, Expires,
ServerSideEncryption, ObjectACL, Meta. Refer to the link below for more details :
https://www.alibabacloud.com/help/en/object-storage-service/latest/copyobject

error it's nil if no error, otherwise it's an error object.

func (Bucket) CopyObjectFrom

func (bucket Bucket) CopyObjectFrom(srcBucketName, srcObjectKey, destObjectKey string, options ...Option) (CopyObjectResult, error)

CopyObjectFrom copies the object to another bucket.

srcBucketName source bucket name. srcObjectKey source object name. destObjectKey target object name. The target bucket name is Bucket.BucketName. options copy options. Check out parameter options in function CopyObject.

error it's nil if no error, otherwise it's an error object.

func (Bucket) CopyObjectTo

func (bucket Bucket) CopyObjectTo(destBucketName, destObjectKey, srcObjectKey string, options ...Option) (CopyObjectResult, error)

CopyObjectTo copies the object to another bucket.

srcObjectKey source object key. The source bucket is Bucket.BucketName . destBucketName target bucket name. destObjectKey target object name. options copy options, check out parameter options in function CopyObject for more details.

error it's nil if no error, otherwise it's an error object.

func (Bucket) CreateLiveChannel

func (bucket Bucket) CreateLiveChannel(channelName string, config LiveChannelConfiguration) (CreateLiveChannelResult, error)

CreateLiveChannel create a live-channel

channelName the name of the channel config configuration of the channel

CreateLiveChannelResult the result of create live-channel error nil if success, otherwise error

func (Bucket) CreateSelectCsvObjectMeta

func (bucket Bucket) CreateSelectCsvObjectMeta(key string, csvMeta CsvMetaRequest, options ...Option) (MetaEndFrameCSV, error)

CreateSelectCsvObjectMeta is Creating csv object meta

key the object key. csvMeta the csv file meta options the options for create csv Meta of the object.

MetaEndFrameCSV the csv file meta info error it's nil if no error, otherwise it's an error object.

func (Bucket) CreateSelectJsonObjectMeta

func (bucket Bucket) CreateSelectJsonObjectMeta(key string, jsonMeta JsonMetaRequest, options ...Option) (MetaEndFrameJSON, error)

CreateSelectJsonObjectMeta is Creating json object meta

key the object key. csvMeta the json file meta options the options for create json Meta of the object.

MetaEndFrameJSON the json file meta info error it's nil if no error, otherwise it's an error object.

func (Bucket) DeleteLiveChannel

func (bucket Bucket) DeleteLiveChannel(channelName string) error

DeleteLiveChannel Delete the live-channel. When a client trying to stream the live-channel, the operation will fail. it will only delete the live-channel itself and the object generated by the live-channel will not be deleted.

channelName the name of the channel

error nil if success, otherwise error

func (Bucket) DeleteMultipleObjectsXml

func (bucket Bucket) DeleteMultipleObjectsXml(xmlData string, options ...Option) (string, error)

DeleteMultipleObjectsXml deletes multiple object or deletes multiple object versions.

xmlData the object keys and versions to delete as the xml format. options the options for deleting objects.

string the result response body. error it's nil if no error, otherwise it's an error.

func (Bucket) DeleteObject

func (bucket Bucket) DeleteObject(objectKey string, options ...Option) error

DeleteObject deletes the object.

objectKey the object key to delete.

error it's nil if no error, otherwise it's an error object.

func (Bucket) DeleteObjectTagging

func (bucket Bucket) DeleteObjectTagging(objectKey string, options ...Option) error

DeleteObjectTagging delete object taggging

objectKey object key to delete tagging

error nil if success, otherwise error

func (Bucket) DeleteObjectVersions

func (bucket Bucket) DeleteObjectVersions(objectVersions []DeleteObject, options ...Option) (DeleteObjectVersionsResult, error)

DeleteObjectVersions deletes multiple object versions.

objectVersions the object keys and versions to delete. options the options for deleting objects.

Supported option is DeleteObjectsQuiet which means it will not return error even deletion failed (not recommended). By default it's not used.

DeleteObjectVersionsResult the result object. error it's nil if no error, otherwise it's an error object.

func (Bucket) DeleteObjects

func (bucket Bucket) DeleteObjects(objectKeys []string, options ...Option) (DeleteObjectsResult, error)

DeleteObjects deletes multiple objects.

objectKeys the object keys to delete. options the options for deleting objects.

Supported option is DeleteObjectsQuiet which means it will not return error even deletion failed (not recommended). By default it's not used.

DeleteObjectsResult the result object. error it's nil if no error, otherwise it's an error object.

func (Bucket) Do

func (bucket Bucket) Do(method, objectName string, params map[string]interface{}, options []Option,
	data io.Reader, listener ProgressListener) (*Response, error)

public

func (Bucket) DoAppendObject

func (bucket Bucket) DoAppendObject(request *AppendObjectRequest, options []Option) (*AppendObjectResult, error)

DoAppendObject is the actual API that does the object append.

request the request object for appending object. options the options for appending object.

AppendObjectResult the result object for appending object. error it's nil if no error, otherwise it's an error object.

func (Bucket) DoGetObject

func (bucket Bucket) DoGetObject(request *GetObjectRequest, options []Option) (*GetObjectResult, error)

DoGetObject is the actual API that gets the object. It's the internal function called by other public APIs.

request the request to download the object. options the options for downloading the file. Checks out the parameter options in method GetObject.

GetObjectResult the result instance of getting the object. error it's nil if no error, otherwise it's an error object.

func (Bucket) DoGetObjectWithURL

func (bucket Bucket) DoGetObjectWithURL(signedURL string, options []Option) (*GetObjectResult, error)

DoGetObjectWithURL is the actual API that downloads the file with the signed URL.

signedURL the signed URL. options the options for getting object. Check out parameter options in GetObject for the reference.

GetObjectResult the result object when the error is nil. error it's nil if no error, otherwise it's an error object.

func (Bucket) DoPostSelectObject

func (bucket Bucket) DoPostSelectObject(key string, params map[string]interface{}, buf *bytes.Buffer, options ...Option) (*SelectObjectResponse, error)

DoPostSelectObject is the SelectObject/CreateMeta api, approve csv and json file.

key the object key. params the resource of oss approve csv/meta, json/meta, csv/select, json/select. buf the request data trans to buffer. options the options for select file of the object.

SelectObjectResponse the response of select object. error it's nil if no error, otherwise it's an error object.

func (Bucket) DoPutObject

func (bucket Bucket) DoPutObject(request *PutObjectRequest, options []Option) (*Response, error)

DoPutObject does the actual upload work.

request the request instance for uploading an object. options the options for uploading an object.

Response the response from OSS. error it's nil if no error, otherwise it's an error object.

func (Bucket) DoPutObjectWithURL

func (bucket Bucket) DoPutObjectWithURL(signedURL string, reader io.Reader, options []Option) (*Response, error)

DoPutObjectWithURL is the actual API that does the upload with URL work(internal for SDK)

signedURL the signed URL. reader io.Reader the read instance for getting the data to upload. options options for uploading.

Response the response object which contains the HTTP response. error it's nil if no error, otherwise it's an error object.

func (Bucket) DoUploadPart

func (bucket Bucket) DoUploadPart(request *UploadPartRequest, options []Option) (*UploadPartResult, error)

DoUploadPart does the actual part upload.

request part upload request

UploadPartResult the result of uploading part. error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) DownloadFile

func (bucket Bucket) DownloadFile(objectKey, filePath string, partSize int64, options ...Option) error

DownloadFile downloads files with multipart download.

objectKey the object key. filePath the local file to download from objectKey in OSS. partSize the part size in bytes. options object's constraints, check out GetObject for the reference.

error it's nil when the call succeeds, otherwise it's an error object.

func (Bucket) GetConfig

func (bucket Bucket) GetConfig() *Config

func (Bucket) GetLiveChannelHistory

func (bucket Bucket) GetLiveChannelHistory(channelName string) (LiveChannelHistory, error)

GetLiveChannelHistory Get push records of live-channel

channelName the name of the channel

LiveChannelHistory push records error nil if success, otherwise error

func (Bucket) GetLiveChannelInfo

func (bucket Bucket) GetLiveChannelInfo(channelName string) (LiveChannelConfiguration, error)

GetLiveChannelInfo Get the configuration info of the live-channel

channelName the name of the channel

LiveChannelConfiguration the configuration info of the live-channel error nil if success, otherwise error

func (Bucket) GetLiveChannelStat

func (bucket Bucket) GetLiveChannelStat(channelName string) (LiveChannelStat, error)

GetLiveChannelStat Get the state of the live-channel

channelName the name of the channel

LiveChannelStat the state of the live-channel error nil if success, otherwise error

func (Bucket) GetObject

func (bucket Bucket) GetObject(objectKey string, options ...Option) (io.ReadCloser, error)

GetObject downloads the object.

objectKey the object key. options the options for downloading the object. The valid values are: Range, IfModifiedSince, IfUnmodifiedSince, IfMatch,

IfNoneMatch, AcceptEncoding. For more details, please check out:
https://www.alibabacloud.com/help/en/object-storage-service/latest/getobject

io.ReadCloser reader instance for reading data from response. It must be called close() after the usage and only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Bucket) GetObjectACL

func (bucket Bucket) GetObjectACL(objectKey string, options ...Option) (GetObjectACLResult, error)

GetObjectACL gets object's ACL

objectKey the object to get ACL from.

GetObjectACLResult the result object when error is nil. GetObjectACLResult.Acl is the object ACL. error it's nil if no error, otherwise it's an error object.

func (Bucket) GetObjectDetailedMeta

func (bucket Bucket) GetObjectDetailedMeta(objectKey string, options ...Option) (http.Header, error)

GetObjectDetailedMeta gets the object's detailed metadata

objectKey object key. options the constraints of the object. Only when the object meets the requirements this method will return the metadata. Otherwise returns error. Valid options are IfModifiedSince, IfUnmodifiedSince,

IfMatch, IfNoneMatch. For more details check out https://www.alibabacloud.com/help/en/object-storage-service/latest/headobject

http.Header object meta when error is nil. error it's nil if no error, otherwise it's an error object.

func (Bucket) GetObjectMeta

func (bucket Bucket) GetObjectMeta(objectKey string, options ...Option) (http.Header, error)

GetObjectMeta gets object metadata.

GetObjectMeta is more lightweight than GetObjectDetailedMeta as it only returns basic metadata including ETag size, LastModified. The size information is in the HTTP header Content-Length.

objectKey object key

http.Header the object's metadata, valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Bucket) GetObjectTagging

func (bucket Bucket) GetObjectTagging(objectKey string, options ...Option) (GetObjectTaggingResult, error)

func (Bucket) GetObjectToFile

func (bucket Bucket) GetObjectToFile(objectKey, filePath string, options ...Option) error

GetObjectToFile downloads the data to a local file.

objectKey the object key to download. filePath the local file to store the object data. options the options for downloading the object. Refer to the parameter options in method GetObject for more details.

error it's nil if no error, otherwise it's an error object.

func (Bucket) GetObjectToFileWithURL

func (bucket Bucket) GetObjectToFileWithURL(signedURL, filePath string, options ...Option) error

GetObjectToFileWithURL downloads the object into a local file with the signed URL.

signedURL the signed URL filePath the local file path to download to. options the options for downloading object. Check out the parameter options in function GetObject for the reference.

error it's nil if no error, otherwise it's an error object.

func (Bucket) GetObjectWithURL

func (bucket Bucket) GetObjectWithURL(signedURL string, options ...Option) (io.ReadCloser, error)

GetObjectWithURL downloads the object and returns the reader instance, with the signed URL.

signedURL the signed URL. options options for downloading the object. Valid options are IfModifiedSince, IfUnmodifiedSince, IfMatch,

IfNoneMatch, AcceptEncoding. For more information, check out the following link:
https://www.alibabacloud.com/help/en/object-storage-service/latest/getobject

io.ReadCloser the reader object for getting the data from response. It needs be closed after the usage. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (bucket Bucket) GetSymlink(objectKey string, options ...Option) (http.Header, error)

GetSymlink gets the symlink object with the specified key. If the symlink object does not exist, returns 404.

objectKey the symlink object's key.

error it's nil if no error, otherwise it's an error object.

When error is nil, the target file key is in the X-Oss-Symlink-Target header of the returned object.

func (Bucket) GetVodPlaylist

func (bucket Bucket) GetVodPlaylist(channelName string, startTime, endTime time.Time) (io.ReadCloser, error)

GetVodPlaylist get the playlist based on the specified channelName, startTime and endTime

channelName the name of the channel startTime the start time of the playlist endTime the endtime of the playlist

io.ReadCloser reader instance for reading data from response. It must be called close() after the usage and only valid when error is nil. error nil if success, otherwise error

func (Bucket) InitiateMultipartUpload

func (bucket Bucket) InitiateMultipartUpload(objectKey string, options ...Option) (InitiateMultipartUploadResult, error)

InitiateMultipartUpload initializes multipart upload

objectKey object name options the object constricts for upload. The valid options are CacheControl, ContentDisposition, ContentEncoding, Expires,

ServerSideEncryption, Meta, check out the following link:
https://www.alibabacloud.com/help/en/object-storage-service/latest/initiatemultipartupload

InitiateMultipartUploadResult the return value of the InitiateMultipartUpload, which is used for calls later on such as UploadPartFromFile,UploadPartCopy. error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) IsObjectExist

func (bucket Bucket) IsObjectExist(objectKey string, options ...Option) (bool, error)

IsObjectExist checks if the object exists.

bool flag of object's existence (true:exists; false:non-exist) when error is nil.

error it's nil if no error, otherwise it's an error object.

func (Bucket) ListLiveChannel

func (bucket Bucket) ListLiveChannel(options ...Option) (ListLiveChannelResult, error)

ListLiveChannel list the live-channels

options Prefix: filter by the name start with the value of "Prefix"

MaxKeys: the maximum count returned
Marker: cursor from which starting list

ListLiveChannelResult live-channel list error nil if success, otherwise error

func (Bucket) ListMultipartUploads

func (bucket Bucket) ListMultipartUploads(options ...Option) (ListMultipartUploadResult, error)

ListMultipartUploads lists all ongoing multipart upload tasks

options listObject's filter. Prefix specifies the returned object's prefix; KeyMarker specifies the returned object's start point in lexicographic order;

MaxKeys specifies the max entries to return; Delimiter is the character for grouping object keys.

ListMultipartUploadResponse the return value if it succeeds, only valid when error is nil. error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) ListObjectVersions

func (bucket Bucket) ListObjectVersions(options ...Option) (ListObjectVersionsResult, error)

ListObjectVersions lists objects of all versions under the current bucket.

func (Bucket) ListObjects

func (bucket Bucket) ListObjects(options ...Option) (ListObjectsResult, error)

ListObjects lists the objects under the current bucket.

options it contains all the filters for listing objects.

It could specify a prefix filter on object keys,  the max keys count to return and the object key marker and the delimiter for grouping object names.
The key marker means the returned objects' key must be greater than it in lexicographic order.

For example, if the bucket has 8 objects, my-object-1, my-object-11, my-object-2, my-object-21,
my-object-22, my-object-3, my-object-31, my-object-32. If the prefix is my-object-2 (no other filters), then it returns
my-object-2, my-object-21, my-object-22 three objects. If the marker is my-object-22 (no other filters), then it returns
my-object-3, my-object-31, my-object-32 three objects. If the max keys is 5, then it returns 5 objects.
The three filters could be used together to achieve filter and paging functionality.
If the prefix is the folder name, then it could list all files under this folder (including the files under its subfolders).
But if the delimiter is specified with '/', then it only returns that folder's files (no subfolder's files). The direct subfolders are in the commonPrefixes properties.
For example, if the bucket has three objects fun/test.jpg, fun/movie/001.avi, fun/movie/007.avi. And if the prefix is "fun/", then it returns all three objects.
But if the delimiter is '/', then only "fun/test.jpg" is returned as files and fun/movie/ is returned as common prefix.

For common usage scenario, check out sample/list_object.go.

ListObjectsResult the return value after operation succeeds (only valid when error is nil).

func (Bucket) ListObjectsV2

func (bucket Bucket) ListObjectsV2(options ...Option) (ListObjectsResultV2, error)

ListObjectsV2 lists the objects under the current bucket. Recommend to use ListObjectsV2 to replace ListObjects ListObjectsResultV2 the return value after operation succeeds (only valid when error is nil).

func (Bucket) ListUploadedParts

func (bucket Bucket) ListUploadedParts(imur InitiateMultipartUploadResult, options ...Option) (ListUploadedPartsResult, error)

ListUploadedParts lists the uploaded parts.

imur the return value of InitiateMultipartUpload.

ListUploadedPartsResponse the return value if it succeeds, only valid when error is nil. error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) OptionsMethod

func (bucket Bucket) OptionsMethod(objectKey string, options ...Option) (http.Header, error)

func (Bucket) PostVodPlaylist

func (bucket Bucket) PostVodPlaylist(channelName, playlistName string, startTime, endTime time.Time) error

PostVodPlaylist create an playlist based on the specified playlist name, startTime and endTime

channelName the name of the channel playlistName the name of the playlist, must end with ".m3u8" startTime the start time of the playlist endTime the endtime of the playlist

error nil if success, otherwise error

func (Bucket) ProcessObject

func (bucket Bucket) ProcessObject(objectKey string, process string, options ...Option) (ProcessObjectResult, error)

ProcessObject apply process on the specified image file.

The supported process includes resize, rotate, crop, watermark, format, udf, customized style, etc.

objectKey object key to process. process process string, such as "image/resize,w_100|sys/saveas,o_dGVzdC5qcGc,b_dGVzdA"

error it's nil if no error, otherwise it's an error object.

func (Bucket) PutLiveChannelStatus

func (bucket Bucket) PutLiveChannelStatus(channelName, status string) error

PutLiveChannelStatus Set the status of the live-channel: enabled/disabled

channelName the name of the channel status enabled/disabled

error nil if success, otherwise error

func (Bucket) PutObject

func (bucket Bucket) PutObject(objectKey string, reader io.Reader, options ...Option) error

PutObject creates a new object and it will overwrite the original one if it exists already.

objectKey the object key in UTF-8 encoding. The length must be between 1 and 1023, and cannot start with "/" or "\". reader io.Reader instance for reading the data for uploading options the options for uploading the object. The valid options here are CacheControl, ContentDisposition, ContentEncoding

Expires, ServerSideEncryption, ObjectACL and Meta. Refer to the link below for more details.
https://www.alibabacloud.com/help/en/object-storage-service/latest/putobject

error it's nil if no error, otherwise it's an error object.

func (Bucket) PutObjectFromFile

func (bucket Bucket) PutObjectFromFile(objectKey, filePath string, options ...Option) error

PutObjectFromFile creates a new object from the local file.

objectKey object key. filePath the local file path to upload. options the options for uploading the object. Refer to the parameter options in PutObject for more details.

error it's nil if no error, otherwise it's an error object.

func (Bucket) PutObjectFromFileWithURL

func (bucket Bucket) PutObjectFromFileWithURL(signedURL, filePath string, options ...Option) error

PutObjectFromFileWithURL uploads an object from a local file with the signed URL. PutObjectFromFileWithURL It does not generate mimetype according to object key's name or the local file name.

signedURL the signed URL. filePath local file path, such as dirfile.txt, for uploading. options options for uploading, same as the options in PutObject function.

error it's nil if no error, otherwise it's an error object.

func (Bucket) PutObjectTagging

func (bucket Bucket) PutObjectTagging(objectKey string, tagging Tagging, options ...Option) error

PutObjectTagging add tagging to object

objectKey object key to add tagging tagging tagging to be added

error nil if success, otherwise error

func (Bucket) PutObjectWithURL

func (bucket Bucket) PutObjectWithURL(signedURL string, reader io.Reader, options ...Option) error

PutObjectWithURL uploads an object with the URL. If the object exists, it will be overwritten. PutObjectWithURL It will not generate minetype according to the key name.

signedURL signed URL. reader io.Reader the read instance for reading the data for the upload. options the options for uploading the data. The valid options are CacheControl, ContentDisposition, ContentEncoding,

Expires, ServerSideEncryption, ObjectACL and custom metadata. Check out the following link for details:
https://www.alibabacloud.com/help/en/object-storage-service/latest/putobject

error it's nil if no error, otherwise it's an error object.

func (bucket Bucket) PutSymlink(symObjectKey string, targetObjectKey string, options ...Option) error

PutSymlink creates a symlink (to point to an existing object)

Symlink cannot point to another symlink. When creating a symlink, it does not check the existence of the target file, and does not check if the target file is symlink. Neither it checks the caller's permission on the target file. All these checks are deferred to the actual GetObject call via this symlink. If trying to add an existing file, as long as the caller has the write permission, the existing one will be overwritten. If the x-oss-meta- is specified, it will be added as the metadata of the symlink file.

symObjectKey the symlink object's key. targetObjectKey the target object key to point to.

error it's nil if no error, otherwise it's an error object.

func (Bucket) RestoreObject

func (bucket Bucket) RestoreObject(objectKey string, options ...Option) error

RestoreObject restores the object from the archive storage.

An archive object is in cold status by default and it cannot be accessed. When restore is called on the cold object, it will become available for access after some time. If multiple restores are called on the same file when the object is being restored, server side does nothing for additional calls but returns success. By default, the restored object is available for access for one day. After that it will be unavailable again. But if another RestoreObject are called after the file is restored, then it will extend one day's access time of that object, up to 7 days.

objectKey object key to restore.

error it's nil if no error, otherwise it's an error object.

func (Bucket) RestoreObjectDetail

func (bucket Bucket) RestoreObjectDetail(objectKey string, restoreConfig RestoreConfiguration, options ...Option) error

RestoreObjectDetail support more features than RestoreObject

func (Bucket) RestoreObjectXML

func (bucket Bucket) RestoreObjectXML(objectKey, configXML string, options ...Option) error

RestoreObjectXML support more features than RestoreObject

func (Bucket) SelectObject

func (bucket Bucket) SelectObject(key string, selectReq SelectRequest, options ...Option) (io.ReadCloser, error)

SelectObject is the select object api, approve csv and json file.

key the object key. selectReq the request data for select object options the options for select file of the object.

o.ReadCloser reader instance for reading data from response. It must be called close() after the usage and only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Bucket) SelectObjectIntoFile

func (bucket Bucket) SelectObjectIntoFile(key, fileName string, selectReq SelectRequest, options ...Option) error

SelectObjectIntoFile is the selectObject to file api

key the object key. fileName saving file's name to localstation. selectReq the request data for select object options the options for select file of the object.

error it's nil if no error, otherwise it's an error object.

func (Bucket) SetObjectACL

func (bucket Bucket) SetObjectACL(objectKey string, objectACL ACLType, options ...Option) error

SetObjectACL updates the object's ACL.

Only the bucket's owner could update object's ACL which priority is higher than bucket's ACL. For example, if the bucket ACL is private and object's ACL is public-read-write. Then object's ACL is used and it means all users could read or write that object. When the object's ACL is not set, then bucket's ACL is used as the object's ACL.

Object read operations include GetObject, HeadObject, CopyObject and UploadPartCopy on the source object; Object write operations include PutObject, PostObject, AppendObject, DeleteObject, DeleteMultipleObjects, CompleteMultipartUpload and CopyObject on target object.

objectKey the target object key (to set the ACL on) objectAcl object ACL. Valid options are PrivateACL, PublicReadACL, PublicReadWriteACL.

error it's nil if no error, otherwise it's an error object.

func (Bucket) SetObjectMeta

func (bucket Bucket) SetObjectMeta(objectKey string, options ...Option) error

SetObjectMeta sets the metadata of the Object.

objectKey object options options for setting the metadata. The valid options are CacheControl, ContentDisposition, ContentEncoding, Expires,

ServerSideEncryption, and custom metadata.

error it's nil if no error, otherwise it's an error object.

func (Bucket) SignRtmpURL

func (bucket Bucket) SignRtmpURL(channelName, playlistName string, expires int64) (string, error)

SignRtmpURL Generate a RTMP push-stream signature URL for the trusted user to push the RTMP stream to the live-channel.

channelName the name of the channel playlistName the name of the playlist, must end with ".m3u8" expires expiration (in seconds)

string singed rtmp push stream url error nil if success, otherwise error

func (Bucket) SignURL

func (bucket Bucket) SignURL(objectKey string, method HTTPMethod, expiredInSec int64, options ...Option) (string, error)

SignURL signs the URL. Users could access the object directly with this URL without getting the AK.

objectKey the target object to sign. signURLConfig the configuration for the signed URL

string returns the signed URL, when error is nil. error it's nil if no error, otherwise it's an error object.

func (Bucket) UploadFile

func (bucket Bucket) UploadFile(objectKey, filePath string, partSize int64, options ...Option) error

UploadFile is multipart file upload.

objectKey the object name. filePath the local file path to upload. partSize the part size in byte. options the options for uploading object.

error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) UploadPart

func (bucket Bucket) UploadPart(imur InitiateMultipartUploadResult, reader io.Reader,
	partSize int64, partNumber int, options ...Option) (UploadPart, error)

UploadPart uploads parts

After initializing a Multipart Upload, the upload Id and object key could be used for uploading the parts. Each part has its part number (ranges from 1 to 10,000). And for each upload Id, the part number identifies the position of the part in the whole file. And thus with the same part number and upload Id, another part upload will overwrite the data. Except the last one, minimal part size is 100KB. There's no limit on the last part size.

imur the returned value of InitiateMultipartUpload. reader io.Reader the reader for the part's data. size the part size. partNumber the part number (ranges from 1 to 10,000). Invalid part number will lead to InvalidArgument error.

UploadPart the return value of the upload part. It consists of PartNumber and ETag. It's valid when error is nil. error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) UploadPartCopy

func (bucket Bucket) UploadPartCopy(imur InitiateMultipartUploadResult, srcBucketName, srcObjectKey string,
	startPosition, partSize int64, partNumber int, options ...Option) (UploadPart, error)

UploadPartCopy uploads part copy

imur the return value of InitiateMultipartUpload copySrc source Object name startPosition the part's start index in the source file partSize the part size partNumber the part number, ranges from 1 to 10,000. If it exceeds the range OSS returns InvalidArgument error. options the constraints of source object for the copy. The copy happens only when these contraints are met. Otherwise it returns error.

CopySourceIfNoneMatch, CopySourceIfModifiedSince  CopySourceIfUnmodifiedSince, check out the following link for the detail
https://www.alibabacloud.com/help/en/object-storage-service/latest/uploadpartcopy

UploadPart the return value consists of PartNumber and ETag. error it's nil if the operation succeeds, otherwise it's an error object.

func (Bucket) UploadPartFromFile

func (bucket Bucket) UploadPartFromFile(imur InitiateMultipartUploadResult, filePath string,
	startPosition, partSize int64, partNumber int, options ...Option) (UploadPart, error)

UploadPartFromFile uploads part from the file.

imur the return value of a successful InitiateMultipartUpload. filePath the local file path to upload. startPosition the start position in the local file. partSize the part size. partNumber the part number (from 1 to 10,000)

UploadPart the return value consists of PartNumber and ETag. error it's nil if the operation succeeds, otherwise it's an error object.

type BucketAccessMonitorXml

type BucketAccessMonitorXml struct {
	XMLName xml.Name `xml:"AccessMonitorConfiguration"`
	Status  string   `xml:"Status"` // access monitor status
}

BucketAccessMonitorXml define get bucket access monitor information

type BucketCnameXml

type BucketCnameXml struct {
	XMLName xml.Name `xml:"ListCnameResult"`
	Bucket  string   `xml:"Bucket"`
	Owner   string   `xml:"Owner"`
	Cname   []Cname  `xml:"Cname"`
}

BucketCnameXml define get the bucket cname information

type BucketInfo

type BucketInfo struct {
	XMLName                xml.Name  `xml:"Bucket"`
	Name                   string    `xml:"Name"`                     // Bucket name
	AccessMonitor          string    `xml:"AccessMonitor"`            // Bucket Access Monitor
	Location               string    `xml:"Location"`                 // Bucket datacenter
	CreationDate           time.Time `xml:"CreationDate"`             // Bucket creation time
	ExtranetEndpoint       string    `xml:"ExtranetEndpoint"`         // Bucket external endpoint
	IntranetEndpoint       string    `xml:"IntranetEndpoint"`         // Bucket internal endpoint
	ACL                    string    `xml:"AccessControlList>Grant"`  // Bucket ACL
	RedundancyType         string    `xml:"DataRedundancyType"`       // Bucket DataRedundancyType
	Owner                  Owner     `xml:"Owner"`                    // Bucket owner
	StorageClass           string    `xml:"StorageClass"`             // Bucket storage class
	SseRule                SSERule   `xml:"ServerSideEncryptionRule"` // Bucket ServerSideEncryptionRule
	Versioning             string    `xml:"Versioning"`               // Bucket Versioning
	TransferAcceleration   string    `xml:"TransferAcceleration"`     // bucket TransferAcceleration
	CrossRegionReplication string    `xml:"CrossRegionReplication"`   // bucket CrossRegionReplication
}

BucketInfo defines Bucket information

type BucketListStyleXml

type BucketListStyleXml struct {
	XMLName xml.Name         `xml:"StyleList"`
	Style   []BucketStyleXml `xml:"Style,omitempty"` // style
}

BucketListStyleXml define the list style of the bucket

type BucketProperties

type BucketProperties struct {
	XMLName      xml.Name  `xml:"Bucket"`
	Name         string    `xml:"Name"`         // Bucket name
	Location     string    `xml:"Location"`     // Bucket datacenter
	CreationDate time.Time `xml:"CreationDate"` // Bucket create time
	StorageClass string    `xml:"StorageClass"` // Bucket storage class
	Region       string    `xml:"Region"`       // Bucket region
}

BucketProperties defines bucket properties

type BucketQoSConfiguration

type BucketQoSConfiguration struct {
	XMLName                   xml.Name `xml:"QoSConfiguration"`
	TotalUploadBandwidth      *int     `xml:"TotalUploadBandwidth"`      // Total upload bandwidth
	IntranetUploadBandwidth   *int     `xml:"IntranetUploadBandwidth"`   // Intranet upload bandwidth
	ExtranetUploadBandwidth   *int     `xml:"ExtranetUploadBandwidth"`   // Extranet upload bandwidth
	TotalDownloadBandwidth    *int     `xml:"TotalDownloadBandwidth"`    // Total download bandwidth
	IntranetDownloadBandwidth *int     `xml:"IntranetDownloadBandwidth"` // Intranet download bandwidth
	ExtranetDownloadBandwidth *int     `xml:"ExtranetDownloadBandwidth"` // Extranet download bandwidth
	TotalQPS                  *int     `xml:"TotalQps"`                  // Total Qps
	IntranetQPS               *int     `xml:"IntranetQps"`               // Intranet Qps
	ExtranetQPS               *int     `xml:"ExtranetQps"`               // Extranet Qps
}

BucketQoSConfiguration define QoS configuration

type BucketRTCXml

type BucketRTCXml struct {
	XMLName xml.Name `xml:"ReplicationRule"`
	RTC     *string  `xml:"RTC>Status,omitempty"`
	ID      string   `xml:"ID,omitempty"`
}

BucketRTCXml define the xml of bucket rtc config

type BucketReplicationLocationXml

type BucketReplicationLocationXml struct {
	XMLName              xml.Name                          `xml:"ReplicationLocation"`
	Location             []string                          `xml:"Location,omitempty"`
	LocationTransferType []ReplicationLocationTransferType `xml:"LocationTransferTypeConstraint>LocationTransferType,omitempty"`
	RTCLocation          []string                          `xml:"LocationRTCConstraint>Location,omitempty"`
}

BucketReplicationLocationXml define the xml of bucket replication location info

type BucketReplicationProgressXml

type BucketReplicationProgressXml struct {
	XMLName xml.Name          `xml:"ReplicationProgress"`
	Rule    []ReplicationRule `xml:"Rule,omitempty"`
}

BucketReplicationProgressXml define the xml of bucket replication config

type BucketReplicationXml

type BucketReplicationXml struct {
	XMLName xml.Name          `xml:"ReplicationConfiguration"`
	Rule    []ReplicationRule `xml:"Rule,omitempty"`
}

BucketReplicationXml define the xml of bucket replication config

type BucketResourceGroupXml

type BucketResourceGroupXml struct {
	XMLName         xml.Name `xml:"BucketResourceGroupConfiguration"`
	ResourceGroupId string   `xml:"ResourceGroupId"` // resource groupId
}

BucketResourceGroupXml define the information of the bucket's resource group

type BucketStat

type BucketStat struct {
	XMLName                     xml.Name `xml:"BucketStat"`
	Storage                     int64    `xml:"Storage"`
	ObjectCount                 int64    `xml:"ObjectCount"`
	MultipartUploadCount        int64    `xml:"MultipartUploadCount"`
	LiveChannelCount            int64    `xml:"LiveChannelCount"`
	LastModifiedTime            int64    `xml:"LastModifiedTime"`
	StandardStorage             int64    `xml:"StandardStorage"`
	StandardObjectCount         int64    `xml:"StandardObjectCount"`
	InfrequentAccessStorage     int64    `xml:"InfrequentAccessStorage"`
	InfrequentAccessRealStorage int64    `xml:"InfrequentAccessRealStorage"`
	InfrequentAccessObjectCount int64    `xml:"InfrequentAccessObjectCount"`
	ArchiveStorage              int64    `xml:"ArchiveStorage"`
	ArchiveRealStorage          int64    `xml:"ArchiveRealStorage"`
	ArchiveObjectCount          int64    `xml:"ArchiveObjectCount"`
	ColdArchiveStorage          int64    `xml:"ColdArchiveStorage"`
	ColdArchiveRealStorage      int64    `xml:"ColdArchiveRealStorage"`
	ColdArchiveObjectCount      int64    `xml:"ColdArchiveObjectCount"`
}

type BucketStyleXml

type BucketStyleXml struct {
	XMLName        xml.Name `xml:"Style"`
	Name           string   `xml:"Name,omitempty"`           // style name
	Content        string   `xml:"Content"`                  // style content
	CreateTime     string   `xml:"CreateTime,omitempty"`     // style create time
	LastModifyTime string   `xml:"LastModifyTime,omitempty"` // style last modify time
}

BucketStyleXml define the information of the bucket's style

type CORSRule

type CORSRule struct {
	XMLName       xml.Name `xml:"CORSRule"`
	AllowedOrigin []string `xml:"AllowedOrigin"` // Allowed origins. By default it's wildcard '*'
	AllowedMethod []string `xml:"AllowedMethod"` // Allowed methods
	AllowedHeader []string `xml:"AllowedHeader"` // Allowed headers
	ExposeHeader  []string `xml:"ExposeHeader"`  // Allowed response headers
	MaxAgeSeconds int      `xml:"MaxAgeSeconds"` // Max cache ages in seconds
}

CORSRule defines CORS rules

type CORSXML

type CORSXML struct {
	XMLName      xml.Name   `xml:"CORSConfiguration"`
	CORSRules    []CORSRule `xml:"CORSRule"`               // CORS rules
	ResponseVary *bool      `xml:"ResponseVary,omitempty"` // return Vary or not
}

CORSXML defines CORS configuration

type CRCCheckError

type CRCCheckError struct {
	// contains filtered or unexported fields
}

CRCCheckError is returned when crc check is inconsistent between client and server

func (CRCCheckError) Error

func (e CRCCheckError) Error() string

Error implements interface error

type CSV

type CSV struct {
	XMLName         xml.Name `xml:"CSV"`
	RecordDelimiter string   `xml:"RecordDelimiter,omitempty"`
	FieldDelimiter  string   `xml:"FieldDelimiter,omitempty"`
	QuoteCharacter  string   `xml:"QuoteCharacter,omitempty"`
}

type CSVSelectInput

type CSVSelectInput struct {
	XMLName          xml.Name `xml:"CSV"`
	FileHeaderInfo   string   `xml:"FileHeaderInfo,omitempty"`
	RecordDelimiter  string   `xml:"RecordDelimiter,omitempty"`
	FieldDelimiter   string   `xml:"FieldDelimiter,omitempty"`
	QuoteCharacter   string   `xml:"QuoteCharacter,omitempty"`
	CommentCharacter string   `xml:"CommentCharacter,omitempty"`
	Range            string   `xml:"Range,omitempty"`
	SplitRange       string
}

type CSVSelectOutput

type CSVSelectOutput struct {
	XMLName         xml.Name `xml:"CSV"`
	RecordDelimiter string   `xml:"RecordDelimiter,omitempty"`
	FieldDelimiter  string   `xml:"FieldDelimiter,omitempty"`
}

type Certificate

type Certificate struct {
	Type           string `xml:"Type"`
	CertId         string `xml:"CertId"`
	Status         string `xml:"Status"`
	CreationDate   string `xml:"CreationDate"`
	Fingerprint    string `xml:"Fingerprint"`
	ValidStartDate string `xml:"ValidStartDate"`
	ValidEndDate   string `xml:"ValidEndDate"`
}

Certificate define Details of domain name certificate

type CertificateConfiguration

type CertificateConfiguration struct {
	CertId            string `xml:"CertId,omitempty"`
	Certificate       string `xml:"Certificate,omitempty"`
	PrivateKey        string `xml:"PrivateKey,omitempty"`
	PreviousCertId    string `xml:"PreviousCertId,omitempty"`
	Force             bool   `xml:"Force,omitempty"`
	DeleteCertificate bool   `xml:"DeleteCertificate,omitempty"`
}

type Client

type Client struct {
	Config     *Config      // OSS client configuration
	Conn       *Conn        // Send HTTP request
	HTTPClient *http.Client //http.Client to use - if nil will make its own
}

Client OSS client

func New

func New(endpoint, accessKeyID, accessKeySecret string, options ...ClientOption) (*Client, error)

New creates a new client.

endpoint the OSS datacenter endpoint such as http://oss-cn-hangzhou.aliyuncs.com . accessKeyId access key Id. accessKeySecret access key secret.

Client creates the new client instance, the returned value is valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) AbortBucketWorm

func (client Client) AbortBucketWorm(bucketName string, options ...Option) error

AbortBucketWorm delete bucket worm Configuration bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) Bucket

func (client Client) Bucket(bucketName string) (*Bucket, error)

Bucket gets the bucket instance.

bucketName the bucket name. Bucket the bucket object, when error is nil.

error it's nil if no error, otherwise it's an error object.

func (Client) CloseMetaQuery

func (client Client) CloseMetaQuery(bucketName string, options ...Option) error

CloseMetaQuery Disables the metadata management feature for a bucket.

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) CompleteBucketWorm

func (client Client) CompleteBucketWorm(bucketName string, wormID string, options ...Option) error

CompleteBucketWorm complete bucket worm Configuration bucketName the bucket name. wormID the worm id error it's nil if no error, otherwise it's an error object.

func (Client) CreateBucket

func (client Client) CreateBucket(bucketName string, options ...Option) error

CreateBucket creates a bucket.

bucketName the bucket name, it's globably unique and immutable. The bucket name can only consist of lowercase letters, numbers and dash ('-').

It must start with lowercase letter or number and the length can only be between 3 and 255.

options options for creating the bucket, with optional ACL. The ACL could be ACLPrivate, ACLPublicRead, and ACLPublicReadWrite. By default it's ACLPrivate.

It could also be specified with StorageClass option, which supports StorageStandard, StorageIA(infrequent access), StorageArchive.

error it's nil if no error, otherwise it's an error object.

func (Client) CreateBucketCnameToken

func (client Client) CreateBucketCnameToken(bucketName string, cname string, options ...Option) (CreateBucketCnameTokenResult, error)

CreateBucketCnameToken create a token for the cname. bucketName the bucket name. cname a custom domain name. error it's nil if no error, otherwise it's an error object.

func (Client) CreateBucketXml

func (client Client) CreateBucketXml(bucketName string, xmlBody string, options ...Option) error

create bucket xml

func (Client) DeleteBucket

func (client Client) DeleteBucket(bucketName string, options ...Option) error

DeleteBucket deletes the bucket. Only empty bucket can be deleted (no object and parts).

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketCORS

func (client Client) DeleteBucketCORS(bucketName string, options ...Option) error

DeleteBucketCORS deletes the bucket's static website settings.

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketCname

func (client Client) DeleteBucketCname(bucketName string, cname string, options ...Option) error

DeleteBucketCname remove the mapping of the custom domain name from a bucket. bucketName the bucket name. cname a custom domain name. error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketEncryption

func (client Client) DeleteBucketEncryption(bucketName string, options ...Option) error

DeleteBucketEncryption delete bucket encryption config bucketName the bucket name. error it's nil if no error, otherwise it's an error bucket

func (Client) DeleteBucketInventory

func (client Client) DeleteBucketInventory(bucketName, strInventoryId string, options ...Option) error

DeleteBucketInventory API operation for Object Storage Service.

Delete Bucket inventory information.

bucketName tht bucket name.

strInventoryId the inventory id.

error it's nil if no error, otherwise it's an error.

func (Client) DeleteBucketLifecycle

func (client Client) DeleteBucketLifecycle(bucketName string, options ...Option) error

DeleteBucketLifecycle deletes the bucket's lifecycle.

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketLogging

func (client Client) DeleteBucketLogging(bucketName string, options ...Option) error

DeleteBucketLogging deletes the logging configuration to disable the logging on the bucket.

bucketName the bucket name to disable the logging.

error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketPolicy

func (client Client) DeleteBucketPolicy(bucketName string, options ...Option) error

DeleteBucketPolicy API operation for Object Storage Service.

Deletes the policy from the bucket.

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketQosInfo

func (client Client) DeleteBucketQosInfo(bucketName string, options ...Option) error

DeleteBucketQosInfo API operation for Object Storage Service.

Delete Bucket QoS information.

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketReplication

func (client Client) DeleteBucketReplication(bucketName string, ruleId string, options ...Option) error

DeleteBucketReplication delete bucket replication configuration bucketName the bucket name. ruleId the ID of the replication configuration. error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketResponseHeader

func (client Client) DeleteBucketResponseHeader(bucketName string, options ...Option) error

DeleteBucketResponseHeader delete response header from a bucket. bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketStyle

func (client Client) DeleteBucketStyle(bucketName, styleName string, options ...Option) error

DeleteBucketStyle delete bucket's style bucketName the bucket name. styleName the bucket style name. string the style result of bucket in xml format. error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketTagging

func (client Client) DeleteBucketTagging(bucketName string, options ...Option) error

DeleteBucketTagging delete bucket tagging bucketName name of bucket error nil if success, otherwise error

func (Client) DeleteBucketTransferAcc

func (client Client) DeleteBucketTransferAcc(bucketName string, options ...Option) error

DeleteBucketTransferAcc delete bucket transfer acceleration configuration bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) DeleteBucketWebsite

func (client Client) DeleteBucketWebsite(bucketName string, options ...Option) error

DeleteBucketWebsite deletes the bucket's static web site settings.

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) DescribeRegions

func (client Client) DescribeRegions(options ...Option) (DescribeRegionsResult, error)

DescribeRegions get describe regions GetDescribeRegionsResult the result of bucket in xml format. error it's nil if no error, otherwise it's an error object.

func (Client) DescribeRegionsXml

func (client Client) DescribeRegionsXml(options ...Option) (string, error)

DescribeRegionsXml get describe regions string the style result of bucket in xml format. error it's nil if no error, otherwise it's an error object.

func (Client) DoMetaQuery

func (client Client) DoMetaQuery(bucketName string, metaQuery MetaQuery, options ...Option) (DoMetaQueryResult, error)

DoMetaQuery Queries the objects that meet specified conditions and lists the information about objects based on specified fields and sorting methods.

bucketName the bucket name

metaQuery the option of query

DoMetaQueryResult the result object upon successful request. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) DoMetaQueryXml

func (client Client) DoMetaQueryXml(bucketName string, metaQueryXml string, options ...Option) (DoMetaQueryResult, error)

DoMetaQueryXml Queries the objects that meet specified conditions and lists the information about objects based on specified fields and sorting methods.

bucketName the bucket name

metaQuery the option of query

DoMetaQueryResult the result object upon successful request. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) ExtendBucketWorm

func (client Client) ExtendBucketWorm(bucketName string, retentionDays int, wormID string, options ...Option) error

ExtendBucketWorm exetend bucket worm Configuration bucketName the bucket name. retentionDays the retention period in days wormID the worm id error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketACL

func (client Client) GetBucketACL(bucketName string, options ...Option) (GetBucketACLResult, error)

GetBucketACL gets the bucket ACL.

bucketName the bucket name.

GetBucketAclResponse the result object, and it's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketAccessMonitor

func (client Client) GetBucketAccessMonitor(bucketName string, options ...Option) (GetBucketAccessMonitorResult, error)

GetBucketAccessMonitor get bucket's access monitor config bucketName the bucket name. GetBucketAccessMonitorResult the access monitor configuration result of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketAccessMonitorXml

func (client Client) GetBucketAccessMonitorXml(bucketName string, options ...Option) (string, error)

GetBucketAccessMonitorXml get bucket's access monitor config bucketName the bucket name. string the access monitor configuration result of bucket xml foramt. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketAsyncTask

func (client Client) GetBucketAsyncTask(bucketName string, taskID string, options ...Option) (AsynFetchTaskInfo, error)

GetBucketAsyncTask API operation for set async fetch task

bucketName tht bucket name.

taskid returned by SetBucketAsyncTask

error it's nil if success, otherwise it's an error.

func (Client) GetBucketCORS

func (client Client) GetBucketCORS(bucketName string, options ...Option) (GetBucketCORSResult, error)

GetBucketCORS gets the bucket's CORS settings.

bucketName the bucket name. GetBucketCORSResult the result object upon successful request. It's only valid when error is nil.

error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketCORSXml

func (client Client) GetBucketCORSXml(bucketName string, options ...Option) (string, error)

func (Client) GetBucketCname

func (client Client) GetBucketCname(bucketName string, options ...Option) (string, error)

GetBucketCname get bucket's binding cname bucketName the bucket name. string the xml configuration of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketCnameToken

func (client Client) GetBucketCnameToken(bucketName string, cname string, options ...Option) (GetBucketCnameTokenResult, error)

GetBucketCnameToken get a token for the cname bucketName the bucket name. cname a custom domain name. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketEncryption

func (client Client) GetBucketEncryption(bucketName string, options ...Option) (GetBucketEncryptionResult, error)

GetBucketEncryption get bucket encryption bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketInfo

func (client Client) GetBucketInfo(bucketName string, options ...Option) (GetBucketInfoResult, error)

GetBucketInfo gets the bucket information.

bucketName the bucket name. GetBucketInfoResult the result object upon successful request. It's only valid when error is nil.

error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketInventory

func (client Client) GetBucketInventory(bucketName string, strInventoryId string, options ...Option) (InventoryConfiguration, error)

GetBucketInventory API operation for Object Storage Service

Get the Bucket inventory.

bucketName tht bucket name.

strInventoryId the inventory id.

InventoryConfiguration the inventory configuration.

error it's nil if no error, otherwise it's an error.

func (Client) GetBucketInventoryXml

func (client Client) GetBucketInventoryXml(bucketName string, strInventoryId string, options ...Option) (string, error)

GetBucketInventoryXml API operation for Object Storage Service

Get the Bucket inventory.

bucketName tht bucket name.

strInventoryId the inventory id.

InventoryConfiguration the inventory configuration.

error it's nil if no error, otherwise it's an error.

func (Client) GetBucketLifecycle

func (client Client) GetBucketLifecycle(bucketName string, options ...Option) (GetBucketLifecycleResult, error)

GetBucketLifecycle gets the bucket's lifecycle settings.

bucketName the bucket name.

GetBucketLifecycleResponse the result object upon successful request. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketLifecycleXml

func (client Client) GetBucketLifecycleXml(bucketName string, options ...Option) (string, error)

func (Client) GetBucketLocation

func (client Client) GetBucketLocation(bucketName string, options ...Option) (string, error)

GetBucketLocation gets the bucket location.

Checks out the following link for more information : https://www.alibabacloud.com/help/en/object-storage-service/latest/getbucketlocation

bucketName the bucket name

string bucket's datacenter location error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketLogging

func (client Client) GetBucketLogging(bucketName string, options ...Option) (GetBucketLoggingResult, error)

GetBucketLogging gets the bucket's logging settings

bucketName the bucket name GetBucketLoggingResponse the result object upon successful request. It's only valid when error is nil.

error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketPolicy

func (client Client) GetBucketPolicy(bucketName string, options ...Option) (string, error)

GetBucketPolicy API operation for Object Storage Service.

Get the policy from the bucket.

bucketName the bucket name.

string return the bucket's policy, and it's only valid when error is nil.

error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketQosInfo

func (client Client) GetBucketQosInfo(bucketName string, options ...Option) (BucketQoSConfiguration, error)

GetBucketQosInfo API operation for Object Storage Service.

Get Bucket Qos information.

bucketName the bucket name.

BucketQoSConfiguration the return qos configuration.

error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketReferer

func (client Client) GetBucketReferer(bucketName string, options ...Option) (GetBucketRefererResult, error)

GetBucketReferer gets the bucket's referrer white list. bucketName the bucket name. GetBucketRefererResult the result object upon successful request. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketRefererXml

func (client Client) GetBucketRefererXml(bucketName string, options ...Option) (string, error)

GetBucketRefererXml gets the bucket's referrer white list. bucketName the bucket name. GetBucketRefererResponse the bucket referer config result in xml format. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketReplication

func (client Client) GetBucketReplication(bucketName string, options ...Option) (string, error)

GetBucketReplication get bucket replication configuration bucketName the bucket name. string the replication configuration. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketReplicationLocation

func (client Client) GetBucketReplicationLocation(bucketName string, options ...Option) (string, error)

GetBucketReplicationLocation get the locations of the target bucket that can be copied to bucketName the bucket name. string the locations of the target bucket that can be copied to. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketReplicationProgress

func (client Client) GetBucketReplicationProgress(bucketName string, ruleId string, options ...Option) (string, error)

GetBucketReplicationProgress get the replication progress of bucket bucketName the bucket name. ruleId the ID of the replication configuration. string the replication progress of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketRequestPayment

func (client Client) GetBucketRequestPayment(bucketName string, options ...Option) (RequestPaymentConfiguration, error)

GetBucketRequestPayment API operation for Object Storage Service.

Get bucket requestPayment

bucketName the bucket name.

RequestPaymentConfiguration the payment configuration

error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketResourceGroup

func (client Client) GetBucketResourceGroup(bucketName string, options ...Option) (GetBucketResourceGroupResult, error)

GetBucketResourceGroup get bucket's resource group bucketName the bucket name. GetBucketResourceGroupResult the resource group configuration result of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketResourceGroupXml

func (client Client) GetBucketResourceGroupXml(bucketName string, options ...Option) (string, error)

GetBucketResourceGroupXml get bucket's resource group bucketName the bucket name. string the resource group result of bucket xml format. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketResponseHeader

func (client Client) GetBucketResponseHeader(bucketName string, options ...Option) (GetBucketResponseHeaderResult, error)

GetBucketResponseHeader get bucket's response header. bucketName the bucket name. GetBucketResponseHeaderResult the response header result of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketResponseHeaderXml

func (client Client) GetBucketResponseHeaderXml(bucketName string, options ...Option) (string, error)

GetBucketResponseHeaderXml get bucket's resource group bucketName the bucket name. string the response header result of bucket xml format. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketStat

func (client Client) GetBucketStat(bucketName string, options ...Option) (GetBucketStatResult, error)

GetBucketStat get bucket stat bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketStyle

func (client Client) GetBucketStyle(bucketName, styleName string, options ...Option) (GetBucketStyleResult, error)

GetBucketStyle get bucket's style bucketName the bucket name. styleName the bucket style name. GetBucketStyleResult the style result of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketStyleXml

func (client Client) GetBucketStyleXml(bucketName, styleName string, options ...Option) (string, error)

GetBucketStyleXml get bucket's style bucketName the bucket name. styleName the bucket style name. string the style result of bucket in xml format. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketTagging

func (client Client) GetBucketTagging(bucketName string, options ...Option) (GetBucketTaggingResult, error)

GetBucketTagging get tagging of the bucket bucketName name of bucket error nil if success, otherwise error

func (Client) GetBucketTransferAcc

func (client Client) GetBucketTransferAcc(bucketName string, options ...Option) (TransferAccConfiguration, error)

GetBucketTransferAcc get bucket transfer acceleration configuration bucketName the bucket name. accConf bucket transfer acceleration configuration error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketVersioning

func (client Client) GetBucketVersioning(bucketName string, options ...Option) (GetBucketVersioningResult, error)

GetBucketVersioning get bucket versioning status:Enabled、Suspended bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketWebsite

func (client Client) GetBucketWebsite(bucketName string, options ...Option) (GetBucketWebsiteResult, error)

GetBucketWebsite gets the bucket's default page (index page) and the error page.

bucketName the bucket name

GetBucketWebsiteResponse the result object upon successful request. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketWebsiteXml

func (client Client) GetBucketWebsiteXml(bucketName string, options ...Option) (string, error)

GetBucketWebsiteXml gets the bucket's website config xml config.

bucketName the bucket name

string the bucket's xml config, It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) GetBucketWorm

func (client Client) GetBucketWorm(bucketName string, options ...Option) (WormConfiguration, error)

GetBucketWorm get bucket worm Configuration bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) GetMetaQueryStatus

func (client Client) GetMetaQueryStatus(bucketName string, options ...Option) (GetMetaQueryStatusResult, error)

GetMetaQueryStatus Queries the information about the metadata index library of a bucket.

bucketName the bucket name

GetMetaQueryStatusResult the result object upon successful request. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) GetUserQoSInfo

func (client Client) GetUserQoSInfo(options ...Option) (UserQoSConfiguration, error)

GetUserQoSInfo API operation for Object Storage Service.

Get user qos.

UserQoSConfiguration the User Qos and range Information.

error it's nil if no error, otherwise it's an error object.

func (Client) InitiateBucketWorm

func (client Client) InitiateBucketWorm(bucketName string, retentionDays int, options ...Option) (string, error)

InitiateBucketWorm creates bucket worm Configuration bucketName the bucket name. retentionDays the retention period in days error it's nil if no error, otherwise it's an error object.

func (Client) IsBucketExist

func (client Client) IsBucketExist(bucketName string) (bool, error)

IsBucketExist checks if the bucket exists

bucketName the bucket name.

bool true if it exists, and it's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) LimitDownloadSpeed

func (client Client) LimitDownloadSpeed(downSpeed int) error

LimitDownloadSpeed set download bandwidth limit speed,default is 0,unlimited downSpeed KB/s, 0 is unlimited,default is 0 error it's nil if success, otherwise failure

func (Client) LimitUploadSpeed

func (client Client) LimitUploadSpeed(upSpeed int) error

LimitUploadSpeed set upload bandwidth limit speed,default is 0,unlimited upSpeed KB/s, 0 is unlimited,default is 0 error it's nil if success, otherwise failure

func (Client) ListBucketCname

func (client Client) ListBucketCname(bucketName string, options ...Option) (ListBucketCnameResult, error)

ListBucketCname list bucket's binding cname bucketName the bucket name. string the xml configuration of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) ListBucketInventory

func (client Client) ListBucketInventory(bucketName, continuationToken string, options ...Option) (ListInventoryConfigurationsResult, error)

ListBucketInventory API operation for Object Storage Service

List the Bucket inventory.

bucketName tht bucket name.

continuationToken the users token.

ListInventoryConfigurationsResult list all inventory configuration by .

error it's nil if no error, otherwise it's an error.

func (Client) ListBucketInventoryXml

func (client Client) ListBucketInventoryXml(bucketName, continuationToken string, options ...Option) (string, error)

ListBucketInventoryXml API operation for Object Storage Service

List the Bucket inventory.

bucketName tht bucket name.

continuationToken the users token.

ListInventoryConfigurationsResult list all inventory configuration by .

error it's nil if no error, otherwise it's an error.

func (Client) ListBucketStyle

func (client Client) ListBucketStyle(bucketName string, options ...Option) (GetBucketListStyleResult, error)

ListBucketStyle get bucket's styles bucketName the bucket name. GetBucketListStyleResult the list style result of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) ListBucketStyleXml

func (client Client) ListBucketStyleXml(bucketName string, options ...Option) (string, error)

ListBucketStyleXml get bucket's list style bucketName the bucket name. string the style result of bucket in xml format. error it's nil if no error, otherwise it's an error object.

func (Client) ListBuckets

func (client Client) ListBuckets(options ...Option) (ListBucketsResult, error)

ListBuckets lists buckets of the current account under the given endpoint, with optional filters.

options specifies the filters such as Prefix, Marker and MaxKeys. Prefix is the bucket name's prefix filter.

And marker makes sure the returned buckets' name are greater than it in lexicographic order.
Maxkeys limits the max keys to return, and by default it's 100 and up to 1000.
For the common usage scenario, please check out list_bucket.go in the sample.

ListBucketsResponse the response object if error is nil.

error it's nil if no error, otherwise it's an error object.

func (Client) ListCloudBoxes

func (client Client) ListCloudBoxes(options ...Option) (ListCloudBoxResult, error)

ListCloudBoxes lists cloud boxes of the current account under the given endpoint, with optional filters.

options specifies the filters such as Prefix, Marker and MaxKeys. Prefix is the bucket name's prefix filter.

And marker makes sure the returned buckets' name are greater than it in lexicographic order.
Maxkeys limits the max keys to return, and by default it's 100 and up to 1000.
For the common usage scenario, please check out list_bucket.go in the sample.

ListBucketsResponse the response object if error is nil.

error it's nil if no error, otherwise it's an error object.

func (Client) OpenMetaQuery

func (client Client) OpenMetaQuery(bucketName string, options ...Option) error

OpenMetaQuery Enables the metadata management feature for a bucket.

bucketName the bucket name.

error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketAccessMonitor

func (client Client) PutBucketAccessMonitor(bucketName string, accessMonitor PutBucketAccessMonitor, options ...Option) error

PutBucketAccessMonitor get bucket's access monitor config bucketName the bucket name. accessMonitor the access monitor configuration of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketAccessMonitorXml

func (client Client) PutBucketAccessMonitorXml(bucketName string, xmlData string, options ...Option) error

PutBucketAccessMonitorXml get bucket's access monitor config bucketName the bucket name. xmlData the access monitor configuration in xml foramt error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketCname

func (client Client) PutBucketCname(bucketName string, cname string, options ...Option) error

PutBucketCname map a custom domain name to a bucket bucketName the bucket name. cname a custom domain name. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketCnameWithCertificate

func (client Client) PutBucketCnameWithCertificate(bucketName string, putBucketCname PutBucketCname, options ...Option) error

PutBucketCnameWithCertificate map a custom domain name to a bucket bucketName the bucket name. PutBucketCname the bucket cname config in struct format. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketCnameXml

func (client Client) PutBucketCnameXml(bucketName string, xmlBody string, options ...Option) error

PutBucketCnameXml map a custom domain name to a bucket bucketName the bucket name. xmlBody the cname configuration in xml foramt error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketRTC

func (client Client) PutBucketRTC(bucketName string, rtc PutBucketRTC, options ...Option) error

PutBucketRTC put bucket replication rtc bucketName the bucket name. rtc the bucket rtc config. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketRTCXml

func (client Client) PutBucketRTCXml(bucketName string, xmlBody string, options ...Option) error

PutBucketRTCXml put bucket rtc configuration bucketName the bucket name. xmlBody the rtc configuration in xml format. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketRefererXml

func (client Client) PutBucketRefererXml(bucketName, xmlData string, options ...Option) error

PutBucketRefererXml set bucket's style bucketName the bucket name. xmlData the style in xml format error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketReplication

func (client Client) PutBucketReplication(bucketName string, xmlBody string, options ...Option) error

PutBucketReplication put bucket replication configuration bucketName the bucket name. xmlBody the replication configuration. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketResourceGroup

func (client Client) PutBucketResourceGroup(bucketName string, resourceGroup PutBucketResourceGroup, options ...Option) error

PutBucketResourceGroup set bucket's resource group bucketName the bucket name. resourceGroup the resource group configuration of bucket. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketResourceGroupXml

func (client Client) PutBucketResourceGroupXml(bucketName string, xmlData string, options ...Option) error

PutBucketResourceGroupXml set bucket's resource group bucketName the bucket name. xmlData the resource group in xml format error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketResponseHeader

func (client Client) PutBucketResponseHeader(bucketName string, responseHeader PutBucketResponseHeader, options ...Option) error

PutBucketResponseHeader set bucket response header bucketName the bucket name. xmlData the resource group in xml format error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketResponseHeaderXml

func (client Client) PutBucketResponseHeaderXml(bucketName, xmlData string, options ...Option) error

PutBucketResponseHeaderXml set bucket response header bucketName the bucket name. xmlData the bucket response header in xml format error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketStyle

func (client Client) PutBucketStyle(bucketName, styleName string, styleContent string, options ...Option) error

PutBucketStyle set bucket's style bucketName the bucket name. styleContent the style content. error it's nil if no error, otherwise it's an error object.

func (Client) PutBucketStyleXml

func (client Client) PutBucketStyleXml(bucketName, styleName, xmlData string, options ...Option) error

PutBucketStyleXml set bucket's style bucketName the bucket name. styleName the style name. xmlData the style in xml format error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketACL

func (client Client) SetBucketACL(bucketName string, bucketACL ACLType, options ...Option) error

SetBucketACL sets bucket's ACL.

bucketName the bucket name bucketAcl the bucket ACL: ACLPrivate, ACLPublicRead and ACLPublicReadWrite.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketAsyncTask

func (client Client) SetBucketAsyncTask(bucketName string, asynConf AsyncFetchTaskConfiguration, options ...Option) (AsyncFetchTaskResult, error)

SetBucketAsyncTask API operation for set async fetch task

bucketName tht bucket name.

asynConf configruation

error it's nil if success, otherwise it's an error.

func (Client) SetBucketCORS

func (client Client) SetBucketCORS(bucketName string, corsRules []CORSRule, options ...Option) error

SetBucketCORS sets the bucket's CORS rules

For more information, please check out https://help.aliyun.com/document_detail/oss/user_guide/security_management/cors.html

bucketName the bucket name corsRules the CORS rules to set. The related sample code is in sample/bucket_cors.go.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketCORSV2

func (client Client) SetBucketCORSV2(bucketName string, putBucketCORS PutBucketCORS, options ...Option) error

SetBucketCORSV2 sets the bucket's CORS rules

bucketName the bucket name putBucketCORS the CORS rules to set.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketCORSXml

func (client Client) SetBucketCORSXml(bucketName string, xmlBody string, options ...Option) error

func (Client) SetBucketEncryption

func (client Client) SetBucketEncryption(bucketName string, encryptionRule ServerEncryptionRule, options ...Option) error

SetBucketEncryption set bucket encryption config bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketInventory

func (client Client) SetBucketInventory(bucketName string, inventoryConfig InventoryConfiguration, options ...Option) error

SetBucketInventory API operation for Object Storage Service

Set the Bucket inventory.

bucketName the bucket name.

inventoryConfig the inventory configuration.

error it's nil if no error, otherwise it's an error.

func (Client) SetBucketInventoryXml

func (client Client) SetBucketInventoryXml(bucketName string, xmlBody string, options ...Option) error

SetBucketInventoryXml API operation for Object Storage Service

Set the Bucket inventory

bucketName the bucket name.

xmlBody the inventory configuration.

error it's nil if no error, otherwise it's an error.

func (Client) SetBucketLifecycle

func (client Client) SetBucketLifecycle(bucketName string, rules []LifecycleRule, options ...Option) error

SetBucketLifecycle sets the bucket's lifecycle.

For more information, checks out following link: https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketlifecycle

bucketName the bucket name. rules the lifecycle rules. There're two kind of rules: absolute time expiration and relative time expiration in days and day/month/year respectively.

Check out sample/bucket_lifecycle.go for more details.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketLifecycleXml

func (client Client) SetBucketLifecycleXml(bucketName string, xmlBody string, options ...Option) error

SetBucketLifecycleXml sets the bucket's lifecycle rule from xml config

func (Client) SetBucketLogging

func (client Client) SetBucketLogging(bucketName, targetBucket, targetPrefix string,
	isEnable bool, options ...Option) error

SetBucketLogging sets the bucket logging settings.

OSS could automatically store the access log. Only the bucket owner could enable the logging. Once enabled, OSS would save all the access log into hourly log files in a specified bucket. For more information, please check out https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketlogging

bucketName bucket name to enable the log. targetBucket the target bucket name to store the log files. targetPrefix the log files' prefix.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketPolicy

func (client Client) SetBucketPolicy(bucketName string, policy string, options ...Option) error

SetBucketPolicy API operation for Object Storage Service.

Set the policy from the bucket.

bucketName the bucket name.

policy the bucket policy.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketQoSInfo

func (client Client) SetBucketQoSInfo(bucketName string, qosConf BucketQoSConfiguration, options ...Option) error

SetBucketQoSInfo API operation for Object Storage Service.

Set Bucket Qos information.

bucketName the bucket name.

qosConf the qos configuration.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketReferer

func (client Client) SetBucketReferer(bucketName string, referrers []string, allowEmptyReferer bool, options ...Option) error

SetBucketReferer sets the bucket's referer whitelist and the flag if allowing empty referrer.

To avoid stealing link on OSS data, OSS supports the HTTP referrer header. A whitelist referrer could be set either by API or web console, as well as the allowing empty referrer flag. Note that this applies to requests from web browser only. For example, for a bucket os-example and its referrer http://www.aliyun.com, all requests from this URL could access the bucket. For more information, please check out this link : https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketreferer

bucketName the bucket name. referrers the referrer white list. A bucket could have a referrer list and each referrer supports one '*' and multiple '?' as wildcards.

The sample could be found in sample/bucket_referer.go

allowEmptyReferer the flag of allowing empty referrer. By default it's true.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketRefererV2

func (client Client) SetBucketRefererV2(bucketName string, setBucketReferer RefererXML, options ...Option) error

SetBucketRefererV2 gets the bucket's referer white list.

setBucketReferer SetBucketReferer bucket referer config in struct format.

GetBucketRefererResponse the result object upon successful request. It's only valid when error is nil. error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketRequestPayment

func (client Client) SetBucketRequestPayment(bucketName string, paymentConfig RequestPaymentConfiguration, options ...Option) error

SetBucketRequestPayment API operation for Object Storage Service.

Set the requestPayment of bucket

bucketName the bucket name.

paymentConfig the payment configuration

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketTagging

func (client Client) SetBucketTagging(bucketName string, tagging Tagging, options ...Option) error

SetBucketTagging add tagging to bucket bucketName name of bucket tagging tagging to be added error nil if success, otherwise error

func (Client) SetBucketTransferAcc

func (client Client) SetBucketTransferAcc(bucketName string, accConf TransferAccConfiguration, options ...Option) error

SetBucketTransferAcc set bucket transfer acceleration configuration bucketName the bucket name. accConf bucket transfer acceleration configuration error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketVersioning

func (client Client) SetBucketVersioning(bucketName string, versioningConfig VersioningConfig, options ...Option) error

SetBucketVersioning set bucket versioning:Enabled、Suspended bucketName the bucket name. error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketWebsite

func (client Client) SetBucketWebsite(bucketName, indexDocument, errorDocument string, options ...Option) error

SetBucketWebsite sets the bucket's static website's index and error page.

OSS supports static web site hosting for the bucket data. When the bucket is enabled with that, you can access the file in the bucket like the way to access a static website. For more information, please check out: https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketwebsite

bucketName the bucket name to enable static web site. indexDocument index page. errorDocument error page.

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketWebsiteDetail

func (client Client) SetBucketWebsiteDetail(bucketName string, wxml WebsiteXML, options ...Option) error

SetBucketWebsiteDetail sets the bucket's static website's detail

OSS supports static web site hosting for the bucket data. When the bucket is enabled with that, you can access the file in the bucket like the way to access a static website. For more information, please check out: https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketwebsite

bucketName the bucket name to enable static web site.

wxml the website's detail

error it's nil if no error, otherwise it's an error object.

func (Client) SetBucketWebsiteXml

func (client Client) SetBucketWebsiteXml(bucketName string, webXml string, options ...Option) error

SetBucketWebsiteXml sets the bucket's static website's rule

OSS supports static web site hosting for the bucket data. When the bucket is enabled with that, you can access the file in the bucket like the way to access a static website. For more information, please check out: https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketwebsite

bucketName the bucket name to enable static web site.

wxml the website's detail

error it's nil if no error, otherwise it's an error object.

func (*Client) SetCloudBoxId

func (client *Client) SetCloudBoxId(cloudBoxId string)

SetCloudBoxId set CloudBoxId for client

cloudBoxId the id of cloudBox

func (*Client) SetProduct

func (client *Client) SetProduct(product string)

SetProduct set Product type for client

Product product type

func (*Client) SetRegion

func (client *Client) SetRegion(region string)

SetRegion set region for client

region the region, such as cn-hangzhou

type ClientOption

type ClientOption func(*Client)

ClientOption client option such as UseCname, Timeout, SecurityToken.

func AdditionalHeaders

func AdditionalHeaders(headers []string) ClientOption

AdditionalHeaders sets special http headers needed to be signed

func AuthProxy

func AuthProxy(proxyHost, proxyUser, proxyPassword string) ClientOption

AuthProxy sets the proxy information with user name and password.

proxyHost the proxy host in the format "host:port". For example, proxy.com:80 . proxyUser the proxy user name. proxyPassword the proxy password.

func AuthVersion

func AuthVersion(authVersion AuthVersionType) ClientOption

AuthVersion sets auth version: v1 or v2 signature which oss_server needed

func CloudBoxId

func CloudBoxId(cloudBoxId string) ClientOption

CloudBoxId set cloudBox id

func EnableCRC

func EnableCRC(isEnableCRC bool) ClientOption

EnableCRC enables the CRC checksum. Default is true.

isEnableCRC true: enable CRC checksum; false: disable the CRC checksum.

func EnableMD5

func EnableMD5(isEnableMD5 bool) ClientOption

EnableMD5 enables MD5 validation.

isEnableMD5 true: enable MD5 validation; false: disable MD5 validation.

func ForcePathStyle

func ForcePathStyle(isPathStyle bool) ClientOption

ForcePathStyle sets the flag of using Path Style. By default it's false.

isPathStyle true: the endpoint has the Path Style, false: the endpoint does not have Path Style. Default is false.

func HTTPClient

func HTTPClient(HTTPClient *http.Client) ClientOption

HTTPClient sets the http.Client in use to the one passed in

func InsecureSkipVerify

func InsecureSkipVerify(enabled bool) ClientOption

InsecureSkipVerify skip verifying tls certificate file

func MD5ThresholdCalcInMemory

func MD5ThresholdCalcInMemory(threshold int64) ClientOption

MD5ThresholdCalcInMemory sets the memory usage threshold for computing the MD5, default is 16MB.

threshold the memory threshold in bytes. When the uploaded content is more than 16MB, the temp file is used for computing the MD5.

func MaxConns

func MaxConns(maxIdleConns, maxIdleConnsPerHost, maxConnsPerHost int) ClientOption

MaxConns sets the HTTP max connections for a client.

maxIdleConns controls the maximum number of idle (keep-alive) connections across all hosts. Default is 100. maxIdleConnsPerHost controls the maximum idle (keep-alive) connections to keep per-host. Default is 100. maxConnsPerHost limits the total number of connections per host. Default is no limit.

func Product

func Product(product string) ClientOption

Product set product type

func Proxy

func Proxy(proxyHost string) ClientOption

Proxy sets the proxy (optional). The default is not using proxy.

proxyHost the proxy host in the format "host:port". For example, proxy.com:80 .

func RedirectEnabled

func RedirectEnabled(enabled bool) ClientOption

RedirectEnabled only effective from go1.7 onward,RedirectEnabled set http redirect enabled or not

func Region

func Region(region string) ClientOption

Region set region

func SecurityToken

func SecurityToken(token string) ClientOption

SecurityToken sets the temporary user's SecurityToken.

token STS token

func SetCredentialsProvider

func SetCredentialsProvider(provider CredentialsProvider) ClientOption

SetCredentialsProvider sets function for get the user's ak

func SetLocalAddr

func SetLocalAddr(localAddr net.Addr) ClientOption

SetLocalAddr sets function for local addr

func SetLogLevel

func SetLogLevel(LogLevel int) ClientOption

SetLogLevel sets the oss sdk log level

func SetLogger

func SetLogger(Logger *log.Logger) ClientOption

SetLogger sets the oss sdk logger

func Timeout

func Timeout(connectTimeoutSec, readWriteTimeout int64) ClientOption

Timeout sets the HTTP timeout in seconds.

connectTimeoutSec HTTP timeout in seconds. Default is 10 seconds. 0 means infinite (not recommended) readWriteTimeout HTTP read or write's timeout in seconds. Default is 20 seconds. 0 means infinite.

func UseCname

func UseCname(isUseCname bool) ClientOption

UseCname sets the flag of using CName. By default it's false.

isUseCname true: the endpoint has the CName, false: the endpoint does not have cname. Default is false.

func UserAgent

func UserAgent(userAgent string) ClientOption

UserAgent specifies UserAgent. The default is aliyun-sdk-go/1.2.0 (windows/-/amd64;go1.5.2).

userAgent the user agent string.

func VerifyObjectStrict

func VerifyObjectStrict(enable bool) ClientOption

VerifyObjectStrict sets the flag of verifying object name strictly.

type CloudBoxProperties

type CloudBoxProperties struct {
	XMLName         xml.Name `xml:"CloudBox"`
	ID              string   `xml:"ID"`
	Name            string   `xml:"Name"`
	Region          string   `xml:"Region"`
	ControlEndpoint string   `xml:"ControlEndpoint"`
	DataEndpoint    string   `xml:"DataEndpoint"`
}

CloudBoxProperties defines cloudbox properties

type Cname

type Cname struct {
	Domain       string      `xml:"Domain"`
	LastModified string      `xml:"LastModified"`
	Status       string      `xml:"Status"`
	Certificate  Certificate `xml:"Certificate"`
}

Cname define the cname information

type CnameConfigurationXML

type CnameConfigurationXML struct {
	XMLName xml.Name `xml:"BucketCnameConfiguration"`
	Domain  string   `xml:"Cname>Domain"`
}

CnameConfigurationXML define cname configuration

type CnameTokenXML

type CnameTokenXML struct {
	XMLName    xml.Name `xml:"CnameToken"`
	Bucket     string   `xml:"Bucket,omitempty"`
	Cname      string   `xml:"Cname,omitempty"`
	Token      string   `xml:"Token,omitempty"`
	ExpireTime string   `xml:"ExpireTime,omitempty"`
}

CnameTokenXML define cname token information

type CompleteMultipartUploadResult

type CompleteMultipartUploadResult struct {
	XMLName  xml.Name `xml:"CompleteMultipartUploadResult"`
	Location string   `xml:"Location"` // Object URL
	Bucket   string   `xml:"Bucket"`   // Bucket name
	ETag     string   `xml:"ETag"`     // Object ETag
	Key      string   `xml:"Key"`      // Object name
}

CompleteMultipartUploadResult defines result object of CompleteMultipartUploadRequest

type Condition

type Condition struct {
	XMLName                     xml.Name        `xml:"Condition"`
	KeyPrefixEquals             string          `xml:"KeyPrefixEquals,omitempty"`             // Matching objcet prefix
	HTTPErrorCodeReturnedEquals int             `xml:"HttpErrorCodeReturnedEquals,omitempty"` // The rule is for Accessing to the specified object
	IncludeHeader               []IncludeHeader `xml:"IncludeHeader"`                         // The rule is for request which include header
}

Condition defines codition in the RoutingRule

type Config

type Config struct {
	Endpoint            string              // OSS endpoint
	AccessKeyID         string              // AccessId
	AccessKeySecret     string              // AccessKey
	RetryTimes          uint                // Retry count by default it's 5.
	UserAgent           string              // SDK name/version/system information
	IsDebug             bool                // Enable debug mode. Default is false.
	Timeout             uint                // Timeout in seconds. By default it's 60.
	SecurityToken       string              // STS Token
	IsCname             bool                // If cname is in the endpoint.
	IsPathStyle         bool                // If Path Style is in the endpoint.
	HTTPTimeout         HTTPTimeout         // HTTP timeout
	HTTPMaxConns        HTTPMaxConns        // Http max connections
	IsUseProxy          bool                // Flag of using proxy.
	ProxyHost           string              // Flag of using proxy host.
	IsAuthProxy         bool                // Flag of needing authentication.
	ProxyUser           string              // Proxy user
	ProxyPassword       string              // Proxy password
	IsEnableMD5         bool                // Flag of enabling MD5 for upload.
	MD5Threshold        int64               // Memory footprint threshold for each MD5 computation (16MB is the default), in byte. When the data is more than that, temp file is used.
	IsEnableCRC         bool                // Flag of enabling CRC for upload.
	LogLevel            int                 // Log level
	Logger              *log.Logger         // For write log
	UploadLimitSpeed    int                 // Upload limit speed:KB/s, 0 is unlimited
	UploadLimiter       *OssLimiter         // Bandwidth limit reader for upload
	DownloadLimitSpeed  int                 // Download limit speed:KB/s, 0 is unlimited
	DownloadLimiter     *OssLimiter         // Bandwidth limit reader for download
	CredentialsProvider CredentialsProvider // User provides interface to get AccessKeyID, AccessKeySecret, SecurityToken
	LocalAddr           net.Addr            // local client host info
	UserSetUa           bool                // UserAgent is set by user or not
	AuthVersion         AuthVersionType     //  v1 or v2, v4 signature,default is v1
	AdditionalHeaders   []string            //  special http headers needed to be sign
	RedirectEnabled     bool                //  only effective from go1.7 onward, enable http redirect or not
	InsecureSkipVerify  bool                //  for https, Whether to skip verifying the server certificate file
	Region              string              //  such as cn-hangzhou
	CloudBoxId          string              //
	Product             string              //  oss or oss-cloudbox, default is oss
	VerifyObjectStrict  bool                //  a flag of verifying object name strictly. Default is enable.
}

Config defines oss configuration

func (*Config) GetCredentials

func (config *Config) GetCredentials() Credentials

for get Credentials

func (*Config) GetSignProduct

func (config *Config) GetSignProduct() string

for get Sign Product

func (*Config) GetSignRegion

func (config *Config) GetSignRegion() string

for get Sign Region

func (*Config) LimitDownloadSpeed

func (config *Config) LimitDownloadSpeed(downloadSpeed int) error

LimitDownLoadSpeed downloadSpeed:KB/s, 0 is unlimited,default is 0

func (*Config) LimitUploadSpeed

func (config *Config) LimitUploadSpeed(uploadSpeed int) error

LimitUploadSpeed uploadSpeed:KB/s, 0 is unlimited,default is 0

func (*Config) WriteLog

func (config *Config) WriteLog(LogLevel int, format string, a ...interface{})

WriteLog output log function

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn defines OSS Conn

func (Conn) Do

func (conn Conn) Do(method, bucketName, objectName string, params map[string]interface{}, headers map[string]string,
	data io.Reader, initCRC uint64, listener ProgressListener) (*Response, error)

Do sends request and returns the response

func (Conn) DoURL

func (conn Conn) DoURL(method HTTPMethod, signedURL string, headers map[string]string,
	data io.Reader, initCRC uint64, listener ProgressListener) (*Response, error)

DoURL sends the request with signed URL and returns the response result.

func (Conn) DoURLWithContext

func (conn Conn) DoURLWithContext(ctx context.Context, method HTTPMethod, signedURL string, headers map[string]string,
	data io.Reader, initCRC uint64, listener ProgressListener) (*Response, error)

DoURLWithContext sends the request with signed URL and context and returns the response result.

func (Conn) DoWithContext

func (conn Conn) DoWithContext(ctx context.Context, method, bucketName, objectName string, params map[string]interface{}, headers map[string]string,
	data io.Reader, initCRC uint64, listener ProgressListener) (*Response, error)

DoWithContext sends request and returns the response with context

func (Conn) LoggerHTTPReq

func (conn Conn) LoggerHTTPReq(req *http.Request)

LoggerHTTPReq Print the header information of the http request

func (Conn) LoggerHTTPResp

func (conn Conn) LoggerHTTPResp(req *http.Request, resp *http.Response)

LoggerHTTPResp Print Response to http request

type CopyObjectResult

type CopyObjectResult struct {
	XMLName      xml.Name  `xml:"CopyObjectResult"`
	LastModified time.Time `xml:"LastModified"` // New object's last modified time.
	ETag         string    `xml:"ETag"`         // New object's ETag
}

CopyObjectResult defines result object of CopyObject

type CreateBucketCnameTokenResult

type CreateBucketCnameTokenResult CnameTokenXML

CreateBucketCnameTokenResult defines result object for CreateBucketCnameToken request

type CreateLiveChannelResult

type CreateLiveChannelResult struct {
	XMLName     xml.Name `xml:"CreateLiveChannelResult"`
	PublishUrls []string `xml:"PublishUrls>Url"` //push urls list
	PlayUrls    []string `xml:"PlayUrls>Url"`    //play urls list
}

CreateLiveChannelResult the result of crete live-channel

type Credentials

type Credentials interface {
	GetAccessKeyID() string
	GetAccessKeySecret() string
	GetSecurityToken() string
}

Credentials is interface for get AccessKeyID,AccessKeySecret,SecurityToken

type CredentialsProvider

type CredentialsProvider interface {
	GetCredentials() Credentials
}

CredentialsProvider is interface for get Credential Info

type CredentialsProviderE

type CredentialsProviderE interface {
	CredentialsProvider
	GetCredentialsE() (Credentials, error)
}

type CsvMetaRequest

type CsvMetaRequest struct {
	XMLName            xml.Name           `xml:"CsvMetaRequest"`
	InputSerialization InputSerialization `xml:"InputSerialization"`
	OverwriteIfExists  *bool              `xml:"OverwriteIfExists,omitempty"`
}

type DataRedundancyType

type DataRedundancyType string

RedundancyType bucket data Redundancy type

const (
	// RedundancyLRS Local redundancy, default value
	RedundancyLRS DataRedundancyType = "LRS"

	// RedundancyZRS Same city redundancy
	RedundancyZRS DataRedundancyType = "ZRS"
)

type DeleteObject

type DeleteObject struct {
	XMLName   xml.Name `xml:"Object"`
	Key       string   `xml:"Key"`                 // Object name
	VersionId string   `xml:"VersionId,omitempty"` // Object VersionId
}

DeleteObject defines the struct for deleting object

type DeleteObjectVersionsResult

type DeleteObjectVersionsResult struct {
	XMLName              xml.Name         `xml:"DeleteResult"`
	DeletedObjectsDetail []DeletedKeyInfo `xml:"Deleted"` // Deleted object detail info
}

DeleteObjectVersionsResult defines result of DeleteObjects request

type DeleteObjectsResult

type DeleteObjectsResult struct {
	XMLName        xml.Name
	DeletedObjects []string // Deleted object key list
}

DeleteObjectsResult defines result of DeleteObjects request

type DeletedKeyInfo

type DeletedKeyInfo struct {
	XMLName               xml.Name `xml:"Deleted"`
	Key                   string   `xml:"Key"`                   // Object key
	VersionId             string   `xml:"VersionId"`             // VersionId
	DeleteMarker          bool     `xml:"DeleteMarker"`          // Object DeleteMarker
	DeleteMarkerVersionId string   `xml:"DeleteMarkerVersionId"` // Object DeleteMarkerVersionId
}

DeletedKeyInfo defines object delete info

type DescribeRegionsResult

type DescribeRegionsResult RegionInfoList

DescribeRegionsResult define get the describe regions result

type DiscardReadCloser

type DiscardReadCloser struct {
	RC      io.ReadCloser
	Discard int
}

func (*DiscardReadCloser) Close

func (drc *DiscardReadCloser) Close() error

func (*DiscardReadCloser) Read

func (drc *DiscardReadCloser) Read(b []byte) (int, error)

type DoMetaQueryResult

type DoMetaQueryResult DoMetaQueryResultXml

DoMetaQueryResult defines result for DoMetaQuery result

type DoMetaQueryResultXml

type DoMetaQueryResultXml struct {
	XMLName      xml.Name                       `xml:"MetaQuery"`
	NextToken    string                         `xml:"NextToken,omitempty"`                 // next token
	Files        []MetaQueryFile                `xml:"Files>File,omitempty"`                // file
	Aggregations []MetaQueryAggregationResponse `xml:"Aggregations>Aggregation,omitempty"'` // Aggregation
}

DoMetaQueryResultXml defines do meta query information

type EndFrame

type EndFrame struct {
	TotalScanned   int64
	HTTPStatusCode int32
	ErrorMsg       string
}

EndFrame is EndFrameType of SelectObject api

type EnvironmentVariableCredentialsProvider

type EnvironmentVariableCredentialsProvider struct {
	// contains filtered or unexported fields
}

func NewEnvironmentVariableCredentialsProvider

func NewEnvironmentVariableCredentialsProvider() (EnvironmentVariableCredentialsProvider, error)

func (*EnvironmentVariableCredentialsProvider) GetCredentials

func (defBuild *EnvironmentVariableCredentialsProvider) GetCredentials() Credentials

type ErrorDocument

type ErrorDocument struct {
	XMLName xml.Name `xml:"ErrorDocument"`
	Key     string   `xml:"Key"` // 404 error file name
}

ErrorDocument defines the 404 error page info

type ExtendWormConfiguration

type ExtendWormConfiguration struct {
	XMLName               xml.Name `xml:"ExtendWormConfiguration"`
	RetentionPeriodInDays int      `xml:"RetentionPeriodInDays"` // specify retention days
}

ExtendWormConfiguration define ExtendWormConfiguration configuration

type FileChunk

type FileChunk struct {
	Number int   // Chunk number
	Offset int64 // Chunk offset
	Size   int64 // Chunk size.
}

FileChunk is the file chunk definition

func SplitFileByPartNum

func SplitFileByPartNum(fileName string, chunkNum int) ([]FileChunk, error)

SplitFileByPartNum splits big file into parts by the num of parts. Split the file with specified parts count, returns the split result when error is nil.

func SplitFileByPartSize

func SplitFileByPartSize(fileName string, chunkSize int64) ([]FileChunk, error)

SplitFileByPartSize splits big file into parts by the size of parts. Splits the file by the part size. Returns the FileChunk when error is nil.

type GetBucketACLResult

type GetBucketACLResult struct {
	XMLName xml.Name `xml:"AccessControlPolicy"`
	ACL     string   `xml:"AccessControlList>Grant"` // Bucket ACL
	Owner   Owner    `xml:"Owner"`                   // Bucket owner
}

GetBucketACLResult defines GetBucketACL request's result

type GetBucketAccessMonitorResult

type GetBucketAccessMonitorResult BucketAccessMonitorXml

GetBucketAccessMonitorResult define config for get bucket access monitor

type GetBucketCORSResult

type GetBucketCORSResult CORSXML

GetBucketCORSResult defines the result from GetBucketCORS request.

type GetBucketCnameTokenResult

type GetBucketCnameTokenResult CnameTokenXML

GetBucketCnameTokenResult defines result object for GetBucketCnameToken request

type GetBucketEncryptionResult

type GetBucketEncryptionResult ServerEncryptionRule

type GetBucketInfoResult

type GetBucketInfoResult struct {
	XMLName    xml.Name   `xml:"BucketInfo"`
	BucketInfo BucketInfo `xml:"Bucket"`
}

GetBucketInfoResult defines the result from GetBucketInfo request.

type GetBucketLifecycleResult

type GetBucketLifecycleResult LifecycleConfiguration

GetBucketLifecycleResult defines GetBucketLifecycle's result object

type GetBucketListStyleResult

type GetBucketListStyleResult BucketListStyleXml

GetBucketListStyleResult define the list style for the bucket

type GetBucketLoggingResult

type GetBucketLoggingResult LoggingXML

GetBucketLoggingResult defines the result from GetBucketLogging request

type GetBucketRefererResult

type GetBucketRefererResult RefererXML

GetBucketRefererResult defines result object for GetBucketReferer request

type GetBucketReplicationLocationResult

type GetBucketReplicationLocationResult BucketReplicationLocationXml

GetBucketReplicationLocationResult define get bucket's replication location

type GetBucketReplicationProgressResult

type GetBucketReplicationProgressResult BucketReplicationProgressXml

GetBucketReplicationProgressResult define get bucket's replication progress

type GetBucketReplicationResult

type GetBucketReplicationResult BucketReplicationXml

GetBucketReplicationResult define get bucket's replication config

type GetBucketResourceGroupResult

type GetBucketResourceGroupResult BucketResourceGroupXml

GetBucketResourceGroupResult define resource group for the bucket

type GetBucketResponseHeaderResult

type GetBucketResponseHeaderResult ResponseHeaderXml

GetBucketResponseHeaderResult define the xml of bucket's response header result

type GetBucketStatResult

type GetBucketStatResult BucketStat

type GetBucketStyleResult

type GetBucketStyleResult BucketStyleXml

GetBucketStyleResult define style for the bucket

type GetBucketTaggingResult

type GetBucketTaggingResult Tagging

type GetBucketVersioningResult

type GetBucketVersioningResult VersioningConfig

type GetBucketWebsiteResult

type GetBucketWebsiteResult WebsiteXML

GetBucketWebsiteResult defines the result from GetBucketWebsite request.

type GetMetaQueryStatusResult

type GetMetaQueryStatusResult GetMetaQueryStatusResultXml

GetMetaQueryStatusResult defines result for GetMetaQueryStatus result

type GetMetaQueryStatusResultXml

type GetMetaQueryStatusResultXml struct {
	XMLName    xml.Name `xml:"MetaQueryStatus"`
	State      string   `xml:"State"`
	Phase      string   `xml:"Phase"`
	CreateTime string   `xml:"CreateTime"`
	UpdateTime string   `xml:"UpdateTime"`
}

GetMetaQueryStatusResultXml define get meta query status information

type GetObjectACLResult

type GetObjectACLResult GetBucketACLResult

GetObjectACLResult defines result of GetObjectACL request

type GetObjectRequest

type GetObjectRequest struct {
	ObjectKey string
}

GetObjectRequest is the request of DoGetObject

type GetObjectResult

type GetObjectResult struct {
	Response  *Response
	ClientCRC hash.Hash64
	ServerCRC uint64
}

GetObjectResult is the result of DoGetObject

type GetObjectTaggingResult

type GetObjectTaggingResult Tagging

GetObjectTaggingResult for GetObjectTagging return value

type HTTPMaxConns

type HTTPMaxConns struct {
	MaxIdleConns        int
	MaxIdleConnsPerHost int
	MaxConnsPerHost     int
}

HTTPMaxConns defines max idle connections and max idle connections per host

type HTTPMethod

type HTTPMethod string

HTTPMethod HTTP request method

const (
	// HTTPGet HTTP GET
	HTTPGet HTTPMethod = "GET"

	// HTTPPut HTTP PUT
	HTTPPut HTTPMethod = "PUT"

	// HTTPHead HTTP HEAD
	HTTPHead HTTPMethod = "HEAD"

	// HTTPPost HTTP POST
	HTTPPost HTTPMethod = "POST"

	// HTTPDelete HTTP DELETE
	HTTPDelete HTTPMethod = "DELETE"
)

type HTTPTimeout

type HTTPTimeout struct {
	ConnectTimeout   time.Duration
	ReadWriteTimeout time.Duration
	HeaderTimeout    time.Duration
	LongTimeout      time.Duration
	IdleConnTimeout  time.Duration
}

HTTPTimeout defines HTTP timeout.

type IncludeHeader

type IncludeHeader struct {
	XMLName xml.Name `xml:"IncludeHeader"`
	Key     string   `xml:"Key,omitempty"`    // The Include header key
	Equals  string   `xml:"Equals,omitempty"` // The Include header value
}

IncludeHeader defines includeHeader in the RoutingRule's Condition

type IndexDocument

type IndexDocument struct {
	XMLName xml.Name `xml:"IndexDocument"`
	Suffix  string   `xml:"Suffix"` // The file name for the index page
}

IndexDocument defines the index page info

type InitiateMultipartUploadResult

type InitiateMultipartUploadResult struct {
	XMLName  xml.Name `xml:"InitiateMultipartUploadResult"`
	Bucket   string   `xml:"Bucket"`   // Bucket name
	Key      string   `xml:"Key"`      // Object name to upload
	UploadID string   `xml:"UploadId"` // Generated UploadId
}

InitiateMultipartUploadResult defines result of InitiateMultipartUpload request

type InitiateWormConfiguration

type InitiateWormConfiguration struct {
	XMLName               xml.Name `xml:"InitiateWormConfiguration"`
	RetentionPeriodInDays int      `xml:"RetentionPeriodInDays"` // specify retention days
}

InitiateWormConfiguration define InitiateBucketWorm configuration

type InputSerialization

type InputSerialization struct {
	XMLName         xml.Name `xml:"InputSerialization"`
	CSV             CSV      `xml:CSV,omitempty`
	JSON            JSON     `xml:JSON,omitempty`
	CompressionType string   `xml:"CompressionType,omitempty"`
}

type InputSerializationSelect

type InputSerializationSelect struct {
	XMLName         xml.Name        `xml:"InputSerialization"`
	CsvBodyInput    CSVSelectInput  `xml:CSV,omitempty`
	JsonBodyInput   JSONSelectInput `xml:JSON,omitempty`
	CompressionType string          `xml:"CompressionType,omitempty"`
}

type InvEncryption

type InvEncryption struct {
	XMLName xml.Name   `xml:"Encryption"`
	SseOss  *InvSseOss `xml:"SSE-OSS"`
	SseKms  *InvSseKms `xml:"SSE-KMS"`
}

type InvSseKms

type InvSseKms struct {
	XMLName xml.Name `xml:"SSE-KMS"`
	KmsId   string   `xml:"KeyId,omitempty"`
}

type InvSseOss

type InvSseOss struct {
	XMLName xml.Name `xml:"SSE-OSS"`
}

type InventoryConfiguration

type InventoryConfiguration struct {
	XMLName                xml.Name             `xml:"InventoryConfiguration"`
	Id                     string               `xml:"Id,omitempty"`
	IsEnabled              *bool                `xml:"IsEnabled,omitempty"`
	Prefix                 string               `xml:"Filter>Prefix,omitempty"`
	OSSBucketDestination   OSSBucketDestination `xml:"Destination>OSSBucketDestination,omitempty"`
	Frequency              string               `xml:"Schedule>Frequency,omitempty"`
	IncludedObjectVersions string               `xml:"IncludedObjectVersions,omitempty"`
	OptionalFields         OptionalFields       `xml:OptionalFields,omitempty`
}

InventoryConfiguration is Inventory config

type JSON

type JSON struct {
	XMLName  xml.Name `xml:"JSON"`
	JSONType string   `xml:"Type,omitempty"`
}

type JSONSelectInput

type JSONSelectInput struct {
	XMLName                 xml.Name `xml:"JSON"`
	JSONType                string   `xml:"Type,omitempty"`
	Range                   string   `xml:"Range,omitempty"`
	ParseJSONNumberAsString *bool    `xml:"ParseJsonNumberAsString"`
	SplitRange              string
}

func (*JSONSelectInput) JsonIsEmpty

func (jsonInput *JSONSelectInput) JsonIsEmpty() bool

type JSONSelectOutput

type JSONSelectOutput struct {
	XMLName         xml.Name `xml:"JSON"`
	RecordDelimiter string   `xml:"RecordDelimiter,omitempty"`
}

type JsonMetaRequest

type JsonMetaRequest struct {
	XMLName            xml.Name           `xml:"JsonMetaRequest"`
	InputSerialization InputSerialization `xml:"InputSerialization"`
	OverwriteIfExists  *bool              `xml:"OverwriteIfExists,omitempty"`
}

type LifecycleAbortMultipartUpload

type LifecycleAbortMultipartUpload struct {
	XMLName           xml.Name `xml:"AbortMultipartUpload"`
	Days              int      `xml:"Days,omitempty"`              // Relative expiration time: The expiration time in days after the last modified time
	CreatedBeforeDate string   `xml:"CreatedBeforeDate,omitempty"` // objects created before the date will be expired
}

LifecycleAbortMultipartUpload defines the rule's abort multipart upload propery

type LifecycleConfiguration

type LifecycleConfiguration struct {
	XMLName xml.Name        `xml:"LifecycleConfiguration"`
	Rules   []LifecycleRule `xml:"Rule"`
}

LifecycleConfiguration is the Bucket Lifecycle configuration

type LifecycleExpiration

type LifecycleExpiration struct {
	XMLName                   xml.Name `xml:"Expiration"`
	Days                      int      `xml:"Days,omitempty"`                      // Relative expiration time: The expiration time in days after the last modified time
	Date                      string   `xml:"Date,omitempty"`                      // Absolute expiration time: The expiration time in date, not recommended
	CreatedBeforeDate         string   `xml:"CreatedBeforeDate,omitempty"`         // objects created before the date will be expired
	ExpiredObjectDeleteMarker *bool    `xml:"ExpiredObjectDeleteMarker,omitempty"` // Specifies whether the expired delete tag is automatically deleted
}

LifecycleExpiration defines the rule's expiration property

type LifecycleFilter

type LifecycleFilter struct {
	XMLName               xml.Name             `xml:"Filter"`
	Not                   []LifecycleFilterNot `xml:"Not,omitempty"`
	ObjectSizeGreaterThan *int64               `xml:"ObjectSizeGreaterThan,omitempty"`
	ObjectSizeLessThan    *int64               `xml:"ObjectSizeLessThan,omitempty"`
}

LifecycleFilter defines the rule's Filter propery

type LifecycleFilterNot

type LifecycleFilterNot struct {
	XMLName xml.Name `xml:"Not"`
	Prefix  string   `xml:"Prefix"`        //Object prefix applicable to this exclusion rule
	Tag     *Tag     `xml:"Tag,omitempty"` //the tags applicable to this exclusion rule
}

LifecycleFilterNot defines the rule's Filter Not propery

type LifecycleRule

type LifecycleRule struct {
	XMLName              xml.Name                       `xml:"Rule"`
	ID                   string                         `xml:"ID,omitempty"`                   // The rule ID
	Prefix               string                         `xml:"Prefix"`                         // The object key prefix
	Status               string                         `xml:"Status"`                         // The rule status (enabled or not)
	Tags                 []Tag                          `xml:"Tag,omitempty"`                  // the tags property
	Expiration           *LifecycleExpiration           `xml:"Expiration,omitempty"`           // The expiration property
	Transitions          []LifecycleTransition          `xml:"Transition,omitempty"`           // The transition property
	AbortMultipartUpload *LifecycleAbortMultipartUpload `xml:"AbortMultipartUpload,omitempty"` // The AbortMultipartUpload property
	NonVersionExpiration *LifecycleVersionExpiration    `xml:"NoncurrentVersionExpiration,omitempty"`
	// Deprecated: Use NonVersionTransitions instead.
	NonVersionTransition  *LifecycleVersionTransition  `xml:"-"` // NonVersionTransition is not suggested to use
	NonVersionTransitions []LifecycleVersionTransition `xml:"NoncurrentVersionTransition,omitempty"`
	Filter                *LifecycleFilter             `xml:Filter,omitempty` //condition parameter container of this exclusion rule
}

LifecycleRule defines Lifecycle rules

func BuildLifecycleRuleByDate

func BuildLifecycleRuleByDate(id, prefix string, status bool, year, month, day int) LifecycleRule

BuildLifecycleRuleByDate builds a lifecycle rule objects will expiration in specified date

func BuildLifecycleRuleByDays

func BuildLifecycleRuleByDays(id, prefix string, status bool, days int) LifecycleRule

BuildLifecycleRuleByDays builds a lifecycle rule objects will expiration in days after the last modified time

type LifecycleTransition

type LifecycleTransition struct {
	XMLName              xml.Name         `xml:"Transition"`
	Days                 int              `xml:"Days,omitempty"`                 // Relative transition time: The transition time in days after the last modified time
	CreatedBeforeDate    string           `xml:"CreatedBeforeDate,omitempty"`    // objects created before the date will be expired
	StorageClass         StorageClassType `xml:"StorageClass,omitempty"`         // Specifies the target storage type
	IsAccessTime         *bool            `xml:"IsAccessTime,omitempty"`         // access time
	ReturnToStdWhenVisit *bool            `xml:"ReturnToStdWhenVisit,omitempty"` // Return To Std When Visit
	AllowSmallFile       *bool            `xml:AllowSmallFile,omitempty`
}

LifecycleTransition defines the rule's transition propery

type LifecycleVersionExpiration

type LifecycleVersionExpiration struct {
	XMLName        xml.Name `xml:"NoncurrentVersionExpiration"`
	NoncurrentDays int      `xml:"NoncurrentDays,omitempty"` // How many days after the Object becomes a non-current version
}

LifecycleVersionExpiration defines the rule's NoncurrentVersionExpiration propery

type LifecycleVersionTransition

type LifecycleVersionTransition struct {
	XMLName              xml.Name         `xml:"NoncurrentVersionTransition"`
	NoncurrentDays       int              `xml:"NoncurrentDays,omitempty"` // How many days after the Object becomes a non-current version
	StorageClass         StorageClassType `xml:"StorageClass,omitempty"`
	IsAccessTime         *bool            `xml:"IsAccessTime,omitempty"`         // access time
	ReturnToStdWhenVisit *bool            `xml:"ReturnToStdWhenVisit,omitempty"` // Return To Std When Visit
	AllowSmallFile       *bool            `xml:AllowSmallFile,omitempty`
}

LifecycleVersionTransition defines the rule's NoncurrentVersionTransition propery

type LimitSpeedReader

type LimitSpeedReader struct {
	io.ReadCloser
	// contains filtered or unexported fields
}

LimitSpeedReader for limit bandwidth upload

func (*LimitSpeedReader) Close

func (r *LimitSpeedReader) Close() error

Close ...

func (*LimitSpeedReader) Read

func (r *LimitSpeedReader) Read(p []byte) (n int, err error)

Read

type LimitedReadCloser

type LimitedReadCloser struct {
	io.LimitedReader
}

LimitedRC support Close()

func (*LimitedReadCloser) Close

func (lc *LimitedReadCloser) Close() error

type ListBucketCnameResult

type ListBucketCnameResult BucketCnameXml

ListBucketCnameResult define the cname list of the bucket

type ListBucketsResult

type ListBucketsResult struct {
	XMLName     xml.Name           `xml:"ListAllMyBucketsResult"`
	Prefix      string             `xml:"Prefix"`         // The prefix in this query
	Marker      string             `xml:"Marker"`         // The marker filter
	MaxKeys     int                `xml:"MaxKeys"`        // The max entry count to return. This information is returned when IsTruncated is true.
	IsTruncated bool               `xml:"IsTruncated"`    // Flag true means there's remaining buckets to return.
	NextMarker  string             `xml:"NextMarker"`     // The marker filter for the next list call
	Owner       Owner              `xml:"Owner"`          // The owner information
	Buckets     []BucketProperties `xml:"Buckets>Bucket"` // The bucket list
}

ListBucketsResult defines the result object from ListBuckets request

type ListCloudBoxResult

type ListCloudBoxResult struct {
	XMLName     xml.Name             `xml:"ListCloudBoxResult"`
	Prefix      string               `xml:"Prefix"`              // The prefix in this query
	Marker      string               `xml:"Marker"`              // The marker filter
	MaxKeys     int                  `xml:"MaxKeys"`             // The max entry count to return. This information is returned when IsTruncated is true.
	IsTruncated bool                 `xml:"IsTruncated"`         // Flag true means there's remaining cloudboxes to return.
	NextMarker  string               `xml:"NextMarker"`          // The marker filter for the next list call
	Owner       string               `xml:"Owner>DisplayName"`   // The owner information
	CloudBoxes  []CloudBoxProperties `xml:"CloudBoxes>CloudBox"` // The cloudbox list
}

ListCloudBoxResult defines the result object from ListBuckets request

type ListInventoryConfigurationsResult

type ListInventoryConfigurationsResult struct {
	XMLName                xml.Name                 `xml:"ListInventoryConfigurationsResult"`
	InventoryConfiguration []InventoryConfiguration `xml:"InventoryConfiguration,omitempty`
	IsTruncated            *bool                    `xml:"IsTruncated,omitempty"`
	NextContinuationToken  string                   `xml:"NextContinuationToken,omitempty"`
}

type ListLiveChannelResult

type ListLiveChannelResult struct {
	XMLName     xml.Name          `xml:"ListLiveChannelResult"`
	Prefix      string            `xml:"Prefix"`      //Filter by the name start with the value of "Prefix"
	Marker      string            `xml:"Marker"`      //cursor from which starting list
	MaxKeys     int               `xml:"MaxKeys"`     //The maximum count returned. the default value is 100. it cannot be greater than 1000.
	IsTruncated bool              `xml:"IsTruncated"` //Indicates whether all results have been returned, "true" indicates partial results returned while "false" indicates all results have been returned
	NextMarker  string            `xml:"NextMarker"`  //NextMarker indicate the Marker value of the next request
	LiveChannel []LiveChannelInfo `xml:"LiveChannel"` //The infomation of live-channel
}

ListLiveChannelResult the result of ListLiveChannel

type ListMultipartUploadResult

type ListMultipartUploadResult struct {
	XMLName            xml.Name            `xml:"ListMultipartUploadsResult"`
	Bucket             string              `xml:"Bucket"`                // Bucket name
	Delimiter          string              `xml:"Delimiter"`             // Delimiter for grouping object.
	Prefix             string              `xml:"Prefix"`                // Object prefix
	KeyMarker          string              `xml:"KeyMarker"`             // Object key marker
	UploadIDMarker     string              `xml:"UploadIdMarker"`        // UploadId marker
	NextKeyMarker      string              `xml:"NextKeyMarker"`         // Next key marker, if not all entries returned.
	NextUploadIDMarker string              `xml:"NextUploadIdMarker"`    // Next uploadId marker, if not all entries returned.
	MaxUploads         int                 `xml:"MaxUploads"`            // Max uploads to return
	IsTruncated        bool                `xml:"IsTruncated"`           // Flag indicates all entries are returned.
	Uploads            []UncompletedUpload `xml:"Upload"`                // Ongoing uploads (not completed, not aborted)
	CommonPrefixes     []string            `xml:"CommonPrefixes>Prefix"` // Common prefixes list.
}

ListMultipartUploadResult defines result object of ListMultipartUpload

type ListObjectVersionsResult

type ListObjectVersionsResult struct {
	XMLName             xml.Name                       `xml:"ListVersionsResult"`
	Name                string                         `xml:"Name"`                  // The Bucket Name
	Owner               Owner                          `xml:"Owner"`                 // The owner of bucket
	Prefix              string                         `xml:"Prefix"`                // The object prefix
	KeyMarker           string                         `xml:"KeyMarker"`             // The start marker filter.
	VersionIdMarker     string                         `xml:"VersionIdMarker"`       // The start VersionIdMarker filter.
	MaxKeys             int                            `xml:"MaxKeys"`               // Max keys to return
	Delimiter           string                         `xml:"Delimiter"`             // The delimiter for grouping objects' name
	IsTruncated         bool                           `xml:"IsTruncated"`           // Flag indicates if all results are returned (when it's false)
	NextKeyMarker       string                         `xml:"NextKeyMarker"`         // The start point of the next query
	NextVersionIdMarker string                         `xml:"NextVersionIdMarker"`   // The start point of the next query
	CommonPrefixes      []string                       `xml:"CommonPrefixes>Prefix"` // You can think of commonprefixes as "folders" whose names end with the delimiter
	ObjectDeleteMarkers []ObjectDeleteMarkerProperties `xml:"DeleteMarker"`          // DeleteMarker list
	ObjectVersions      []ObjectVersionProperties      `xml:"Version"`               // version list
}

ListObjectVersionsResult defines the result from ListObjectVersions request

type ListObjectsResult

type ListObjectsResult struct {
	XMLName        xml.Name           `xml:"ListBucketResult"`
	Prefix         string             `xml:"Prefix"`                // The object prefix
	Marker         string             `xml:"Marker"`                // The marker filter.
	MaxKeys        int                `xml:"MaxKeys"`               // Max keys to return
	Delimiter      string             `xml:"Delimiter"`             // The delimiter for grouping objects' name
	IsTruncated    bool               `xml:"IsTruncated"`           // Flag indicates if all results are returned (when it's false)
	NextMarker     string             `xml:"NextMarker"`            // The start point of the next query
	Objects        []ObjectProperties `xml:"Contents"`              // Object list
	CommonPrefixes []string           `xml:"CommonPrefixes>Prefix"` // You can think of commonprefixes as "folders" whose names end with the delimiter
}

ListObjectsResult defines the result from ListObjects request

type ListObjectsResultV2

type ListObjectsResultV2 struct {
	XMLName               xml.Name           `xml:"ListBucketResult"`
	Prefix                string             `xml:"Prefix"`                // The object prefix
	StartAfter            string             `xml:"StartAfter"`            // the input StartAfter
	ContinuationToken     string             `xml:"ContinuationToken"`     // the input ContinuationToken
	MaxKeys               int                `xml:"MaxKeys"`               // Max keys to return
	Delimiter             string             `xml:"Delimiter"`             // The delimiter for grouping objects' name
	IsTruncated           bool               `xml:"IsTruncated"`           // Flag indicates if all results are returned (when it's false)
	NextContinuationToken string             `xml:"NextContinuationToken"` // The start point of the next NextContinuationToken
	Objects               []ObjectProperties `xml:"Contents"`              // Object list
	CommonPrefixes        []string           `xml:"CommonPrefixes>Prefix"` // You can think of commonprefixes as "folders" whose names end with the delimiter
}

ListObjectsResultV2 defines the result from ListObjectsV2 request

type ListUploadedPartsResult

type ListUploadedPartsResult struct {
	XMLName              xml.Name       `xml:"ListPartsResult"`
	Bucket               string         `xml:"Bucket"`               // Bucket name
	Key                  string         `xml:"Key"`                  // Object name
	UploadID             string         `xml:"UploadId"`             // Upload ID
	NextPartNumberMarker string         `xml:"NextPartNumberMarker"` // Next part number
	MaxParts             int            `xml:"MaxParts"`             // Max parts count
	IsTruncated          bool           `xml:"IsTruncated"`          // Flag indicates all entries returned.false: all entries returned.
	UploadedParts        []UploadedPart `xml:"Part"`                 // Uploaded parts
}

ListUploadedPartsResult defines result object of ListUploadedParts

type LiveChannelAudio

type LiveChannelAudio struct {
	XMLName    xml.Name `xml:"Audio"`
	SampleRate int      `xml:"SampleRate"` //SampleRate
	Bandwidth  int      `xml:"Bandwidth"`  //Bandwidth (unit: B/s)
	Codec      string   `xml:"Codec"`      //Encoding forma
}

LiveChannelAudio audio stream information

type LiveChannelConfiguration

type LiveChannelConfiguration struct {
	XMLName     xml.Name          `xml:"LiveChannelConfiguration"`
	Description string            `xml:"Description,omitempty"` //Description of live-channel, up to 128 bytes
	Status      string            `xml:"Status,omitempty"`      //�Specify the status of livechannel
	Target      LiveChannelTarget `xml:"Target"`                //target configuration of live-channel
	// use point instead of struct to avoid omit empty snapshot
	Snapshot *LiveChannelSnapshot `xml:"Snapshot,omitempty"` //snapshot configuration of live-channel
}

LiveChannelConfiguration defines the configuration for live-channel

type LiveChannelHistory

type LiveChannelHistory struct {
	XMLName xml.Name     `xml:"LiveChannelHistory"`
	Record  []LiveRecord `xml:"LiveRecord"` //push records list
}

LiveChannelHistory the result of GetLiveChannelHistory, at most return up to lastest 10 push records

type LiveChannelInfo

type LiveChannelInfo struct {
	XMLName      xml.Name  `xml:"LiveChannel"`
	Name         string    `xml:"Name"`            //The name of live-channel
	Description  string    `xml:"Description"`     //Description of live-channel
	Status       string    `xml:"Status"`          //Status: disabled or enabled
	LastModified time.Time `xml:"LastModified"`    //Last modification time, format: ISO8601
	PublishUrls  []string  `xml:"PublishUrls>Url"` //push urls list
	PlayUrls     []string  `xml:"PlayUrls>Url"`    //play urls list
}

LiveChannelInfo the infomation of live-channel

type LiveChannelSnapshot

type LiveChannelSnapshot struct {
	XMLName     xml.Name `xml:"Snapshot"`
	RoleName    string   `xml:"RoleName,omitempty"`    //The role of snapshot operations, it sholud has write permission of DestBucket and the permission to send messages to the NotifyTopic.
	DestBucket  string   `xml:"DestBucket,omitempty"`  //Bucket the snapshots will be written to. should be the same owner as the source bucket.
	NotifyTopic string   `xml:"NotifyTopic,omitempty"` //Topics of MNS for notifying users of high frequency screenshot operation results
	Interval    int      `xml:"Interval,omitempty"`    //interval of snapshots, threre is no snapshot if no I-frame during the interval time
}

LiveChannelSnapshot snapshot configuration of live-channel

type LiveChannelStat

type LiveChannelStat struct {
	XMLName       xml.Name         `xml:"LiveChannelStat"`
	Status        string           `xml:"Status"`        //Current push status of live-channel: Disabled,Live,Idle
	ConnectedTime time.Time        `xml:"ConnectedTime"` //The time when the client starts pushing, format: ISO8601
	RemoteAddr    string           `xml:"RemoteAddr"`    //The ip address of the client
	Video         LiveChannelVideo `xml:"Video"`         //Video stream information
	Audio         LiveChannelAudio `xml:"Audio"`         //Audio stream information
}

LiveChannelStat the result of get live-channel state

type LiveChannelTarget

type LiveChannelTarget struct {
	XMLName      xml.Name `xml:"Target"`
	Type         string   `xml:"Type"`                   //the type of object, only supports HLS
	FragDuration int      `xml:"FragDuration,omitempty"` //the length of each ts object (in seconds), in the range [1,100]
	FragCount    int      `xml:"FragCount,omitempty"`    //the number of ts objects in the m3u8 object, in the range of [1,100]
	PlaylistName string   `xml:"PlaylistName,omitempty"` //the name of m3u8 object, which must end with ".m3u8" and the length range is [6,128]
}

LiveChannelTarget target configuration of live-channel

type LiveChannelVideo

type LiveChannelVideo struct {
	XMLName   xml.Name `xml:"Video"`
	Width     int      `xml:"Width"`     //Width (unit: pixels)
	Height    int      `xml:"Height"`    //Height (unit: pixels)
	FrameRate int      `xml:"FrameRate"` //FramRate
	Bandwidth int      `xml:"Bandwidth"` //Bandwidth (unit: B/s)
}

LiveChannelVideo video stream information

type LiveRecord

type LiveRecord struct {
	XMLName    xml.Name  `xml:"LiveRecord"`
	StartTime  time.Time `xml:"StartTime"`  //StartTime, format: ISO8601
	EndTime    time.Time `xml:"EndTime"`    //EndTime, format: ISO8601
	RemoteAddr string    `xml:"RemoteAddr"` //The ip address of remote client
}

LiveRecord push recode

type LoggingEnabled

type LoggingEnabled struct {
	XMLName      xml.Name `xml:"LoggingEnabled"`
	TargetBucket string   `xml:"TargetBucket"` // The bucket name for storing the log files
	TargetPrefix string   `xml:"TargetPrefix"` // The log file prefix
}

LoggingEnabled defines the logging configuration information

type LoggingXML

type LoggingXML struct {
	XMLName        xml.Name       `xml:"BucketLoggingStatus"`
	LoggingEnabled LoggingEnabled `xml:"LoggingEnabled"` // The logging configuration information
}

LoggingXML defines logging configuration

type MetaEndFrameCSV

type MetaEndFrameCSV struct {
	TotalScanned int64
	Status       int32
	SplitsCount  int32
	RowsCount    int64
	ColumnsCount int32
	ErrorMsg     string
}

MetaEndFrameCSV is MetaEndFrameCSVType of CreateSelectObjectMeta

type MetaEndFrameJSON

type MetaEndFrameJSON struct {
	TotalScanned int64
	Status       int32
	SplitsCount  int32
	RowsCount    int64
	ErrorMsg     string
}

MetaEndFrameJSON is MetaEndFrameJSON of CreateSelectObjectMeta

type MetaQuery

type MetaQuery struct {
	XMLName      xml.Name                      `xml:"MetaQuery"`
	NextToken    string                        `xml:"NextToken,omitempty"`
	MaxResults   int64                         `xml:"MaxResults,omitempty"`
	Query        string                        `xml:"Query"`
	Sort         string                        `xml:"Sort,omitempty"`
	Order        string                        `xml:"Order,omitempty"`
	Aggregations []MetaQueryAggregationRequest `xml:"Aggregations>Aggregation,omitempty"`
}

MetaQuery defines meta query struct

type MetaQueryAggregationRequest

type MetaQueryAggregationRequest struct {
	XMLName   xml.Name `xml:"Aggregation"`
	Field     string   `xml:"Field,omitempty"`
	Operation string   `xml:"Operation,omitempty"`
}

MetaQueryAggregationRequest defines meta query aggregation request

type MetaQueryAggregationResponse

type MetaQueryAggregationResponse struct {
	XMLName   xml.Name         `xml:"Aggregation"`
	Field     string           `xml:"Field,omitempty"`
	Operation string           `xml:"Operation,omitempty"`
	Value     float64          `xml:"Value,omitempty"`
	Groups    []MetaQueryGroup `xml:"Groups>Group,omitempty"`
}

MetaQueryAggregationResponse defines meta query aggregation response

type MetaQueryFile

type MetaQueryFile struct {
	XMLName                               xml.Name            `xml:"File"`
	Filename                              string              `xml:"Filename"`                                        //file name
	Size                                  int64               `xml:"Size"`                                            // file size
	FileModifiedTime                      string              `xml:"FileModifiedTime"`                                // file Modified Time
	OssObjectType                         string              `xml:"OSSObjectType"`                                   // Oss Object Type
	OssStorageClass                       string              `xml:"OSSStorageClass"`                                 // Oss Storage Class
	ObjectACL                             string              `xml:"ObjectACL"`                                       // Object Acl
	ETag                                  string              `xml:"ETag"`                                            // ETag
	OssCRC64                              string              `xml:"OSSCRC64"`                                        // Oss CRC64
	OssTaggingCount                       int64               `xml:"OSSTaggingCount,omitempty"`                       // Oss Tagging Count
	OssTagging                            []MetaQueryTagging  `xml:"OSSTagging>Tagging,omitempty"`                    // Tagging
	OssUserMeta                           []MetaQueryUserMeta `xml:"OSSUserMeta>UserMeta,omitempty"`                  // UserMeta
	ServerSideEncryption                  string              `xml:"ServerSideEncryption,omitempty"`                  //Server Side Encryption
	ServerSideEncryptionCustomerAlgorithm string              `xml:"ServerSideEncryptionCustomerAlgorithm,omitempty"` // Server Side Encryption Customer Algorithm
}

MetaQueryFile defines do meta query result file information

type MetaQueryGroup

type MetaQueryGroup struct {
	XMLName xml.Name `xml:"Group"`
	Value   string   `xml:"Value"`
	Count   int64    `xml:"Count"`
}

MetaQueryGroup defines do meta query result group information

type MetaQueryTagging

type MetaQueryTagging struct {
	XMLName xml.Name `xml:"Tagging"`
	Key     string   `xml:"Key"`
	Value   string   `xml:"Value"`
}

MetaQueryTagging defines do meta query result tagging information

type MetaQueryUserMeta

type MetaQueryUserMeta struct {
	XMLName xml.Name `xml:"UserMeta"`
	Key     string   `xml:"Key"`
	Value   string   `xml:"Value"`
}

MetaQueryUserMeta defines do meta query result user meta information

type MetadataDirectiveType

type MetadataDirectiveType string

MetadataDirectiveType specifying whether use the metadata of source object when copying object.

const (
	// MetaCopy the target object's metadata is copied from the source one
	MetaCopy MetadataDirectiveType = "COPY"

	// MetaReplace the target object's metadata is created as part of the copy request (not same as the source one)
	MetaReplace MetadataDirectiveType = "REPLACE"
)

type MirrorHeaderSet

type MirrorHeaderSet struct {
	XMLName xml.Name `xml:"Set"`
	Key     string   `xml:"Key,omitempty"`   // The mirror header key
	Value   string   `xml:"Value,omitempty"` // The mirror header value
}

MirrorHeaderSet defines Set for Redirect's MirrorHeaders

type MirrorHeaders

type MirrorHeaders struct {
	XMLName xml.Name          `xml:"MirrorHeaders"`
	PassAll *bool             `xml:"PassAll"` // Penetrating all of headers to source website.
	Pass    []string          `xml:"Pass"`    // Penetrating some of headers to source website.
	Remove  []string          `xml:"Remove"`  // Prohibit passthrough some of headers to source website
	Set     []MirrorHeaderSet `xml:"Set"`     // Setting some of headers send to source website
}

MirrorHeaders defines MirrorHeaders in the Redirect

type OSSBucketDestination

type OSSBucketDestination struct {
	XMLName    xml.Name       `xml:"OSSBucketDestination"`
	Format     string         `xml:"Format,omitempty"`
	AccountId  string         `xml:"AccountId,omitempty"`
	RoleArn    string         `xml:"RoleArn,omitempty"`
	Bucket     string         `xml:"Bucket,omitempty"`
	Prefix     string         `xml:"Prefix,omitempty"`
	Encryption *InvEncryption `xml:"Encryption,omitempty"`
}

type ObjectDeleteMarkerProperties

type ObjectDeleteMarkerProperties struct {
	XMLName      xml.Name  `xml:"DeleteMarker"`
	Key          string    `xml:"Key"`          // The Object Key
	VersionId    string    `xml:"VersionId"`    // The Object VersionId
	IsLatest     bool      `xml:"IsLatest"`     // is current version or not
	LastModified time.Time `xml:"LastModified"` // Object last modified time
	Owner        Owner     `xml:"Owner"`        // bucket owner element
}

type ObjectProperties

type ObjectProperties struct {
	XMLName      xml.Name  `xml:"Contents"`
	Key          string    `xml:"Key"`                   // Object key
	Type         string    `xml:"Type"`                  // Object type
	Size         int64     `xml:"Size"`                  // Object size
	ETag         string    `xml:"ETag"`                  // Object ETag
	Owner        Owner     `xml:"Owner"`                 // Object owner information
	LastModified time.Time `xml:"LastModified"`          // Object last modified time
	StorageClass string    `xml:"StorageClass"`          // Object storage class (Standard, IA, Archive)
	RestoreInfo  string    `xml:"RestoreInfo,omitempty"` // Object restoreInfo
}

ObjectProperties defines Objecct properties

type ObjectVersionProperties

type ObjectVersionProperties struct {
	XMLName      xml.Name  `xml:"Version"`
	Key          string    `xml:"Key"`                   // The Object Key
	VersionId    string    `xml:"VersionId"`             // The Object VersionId
	IsLatest     bool      `xml:"IsLatest"`              // is latest version or not
	LastModified time.Time `xml:"LastModified"`          // Object last modified time
	Type         string    `xml:"Type"`                  // Object type
	Size         int64     `xml:"Size"`                  // Object size
	ETag         string    `xml:"ETag"`                  // Object ETag
	StorageClass string    `xml:"StorageClass"`          // Object storage class (Standard, IA, Archive)
	Owner        Owner     `xml:"Owner"`                 // bucket owner element
	RestoreInfo  string    `xml:"RestoreInfo,omitempty"` // Object restoreInfo
}

type ObjecthashFuncType

type ObjecthashFuncType string

ObjecthashFuncType

const (
	HashFuncSha1   ObjecthashFuncType = "SHA-1"
	HashFuncSha256 ObjecthashFuncType = "SHA-256"
)

type Option

type Option func(map[string]optionValue) error

Option HTTP option

func ACL

func ACL(acl ACLType) Option

ACL is an option to set X-Oss-Acl header

func ACReqHeaders

func ACReqHeaders(value string) Option

ACReqHeaders is an option to set Access-Control-Request-Headers header

func ACReqMethod

func ACReqMethod(value string) Option

ACReqMethod is an option to set Access-Control-Request-Method header

func AcceptEncoding

func AcceptEncoding(value string) Option

AcceptEncoding is an option to set Accept-Encoding header

func AddContentType

func AddContentType(options []Option, keys ...string) []Option

func AddParam

func AddParam(key string, value interface{}) Option

AddParam Allow users to set personalized http params

func AllowSameActionOverLap

func AllowSameActionOverLap(enabled bool) Option

ForbidOverWrite is an option to set X-Oss-Forbid-Overwrite

func CacheControl

func CacheControl(value string) Option

CacheControl is an option to set Cache-Control header

func Callback

func Callback(callback string) Option

Callback is an option to set callback values

func CallbackResult

func CallbackResult(body *[]byte) Option

CallbackResult for get response of call back

func CallbackVar

func CallbackVar(callbackVar string) Option

CallbackVar is an option to set callback user defined values

func Checkpoint

func Checkpoint(isEnable bool, filePath string) Option

Checkpoint sets the isEnable flag and checkpoint file path for DownloadFile/UploadFile.

func CheckpointDir

func CheckpointDir(isEnable bool, dirPath string) Option

CheckpointDir sets the isEnable flag and checkpoint dir path for DownloadFile/UploadFile.

func ChoiceAbortPartOption

func ChoiceAbortPartOption(options []Option) []Option

ChoiceAbortPartOption choices valid option supported by AbortMultipartUpload

func ChoiceCompletePartOption

func ChoiceCompletePartOption(options []Option) []Option

ChoiceCompletePartOption choices valid option supported by CompleteMulitiPart

func ChoiceHeadObjectOption

func ChoiceHeadObjectOption(options []Option) []Option

ChoiceHeadObjectOption choices valid option supported by HeadObject

func ChoiceTransferPartOption

func ChoiceTransferPartOption(options []Option) []Option

choiceTransferPartOption choices valid option supported by Uploadpart or DownloadPart

func ContentDisposition

func ContentDisposition(value string) Option

ContentDisposition is an option to set Content-Disposition header

func ContentEncoding

func ContentEncoding(value string) Option

ContentEncoding is an option to set Content-Encoding header

func ContentLanguage

func ContentLanguage(value string) Option

ContentLanguage is an option to set Content-Language header

func ContentLength

func ContentLength(length int64) Option

ContentLength is an option to set Content-Length header

func ContentMD5

func ContentMD5(value string) Option

ContentMD5 is an option to set Content-MD5 header

func ContentType

func ContentType(value string) Option

ContentType is an option to set Content-Type header

func ContinuationToken

func ContinuationToken(value string) Option

ContinuationToken is an option to set Continuation-token parameter for ListObjectsV2

func CopySource

func CopySource(sourceBucket, sourceObject string) Option

CopySource is an option to set X-Oss-Copy-Source header

func CopySourceIfMatch

func CopySourceIfMatch(value string) Option

CopySourceIfMatch is an option to set X-Oss-Copy-Source-If-Match header

func CopySourceIfModifiedSince

func CopySourceIfModifiedSince(t time.Time) Option

CopySourceIfModifiedSince is an option to set X-Oss-CopySource-If-Modified-Since header

func CopySourceIfNoneMatch

func CopySourceIfNoneMatch(value string) Option

CopySourceIfNoneMatch is an option to set X-Oss-Copy-Source-If-None-Match header

func CopySourceIfUnmodifiedSince

func CopySourceIfUnmodifiedSince(t time.Time) Option

CopySourceIfUnmodifiedSince is an option to set X-Oss-Copy-Source-If-Unmodified-Since header

func CopySourceRange

func CopySourceRange(startPosition, partSize int64) Option

CopySourceRange is an option to set X-Oss-Copy-Source header

func CopySourceVersion

func CopySourceVersion(sourceBucket, sourceObject string, versionId string) Option

CopySourceVersion is an option to set X-Oss-Copy-Source header,include versionId

func DeleteObjectsQuiet

func DeleteObjectsQuiet(isQuiet bool) Option

DeleteObjectsQuiet false:DeleteObjects in verbose mode; true:DeleteObjects in quite mode. Default is false.

func DeleteOption

func DeleteOption(options []Option, strKey string) []Option

func Delimiter

func Delimiter(value string) Option

Delimiter is an option to set delimiler parameter

func EnableMd5

func EnableMd5() Option

EnableMd5 is an option to set x-oss-enable-md5 parameter for InitiateMultipartUpload

func EnableSha1

func EnableSha1() Option

EnableSha1 is an option to set x-oss-enable-sha1 parameter for InitiateMultipartUpload

func EnableSha256

func EnableSha256() Option

EnableSha256 is an option to set x-oss-enable-sha256 parameter for InitiateMultipartUpload

func EncodingType

func EncodingType(value string) Option

EncodingType is an option to set encoding-type parameter

func Expires

func Expires(t time.Time) Option

Expires is an option to set Expires header

func FetchOwner

func FetchOwner(value bool) Option

FetchOwner is an option to set Fetch-owner parameter for ListObjectsV2

func ForbidOverWrite

func ForbidOverWrite(forbidWrite bool) Option

ForbidOverWrite is an option to set X-Oss-Forbid-Overwrite

func GetResponseHeader

func GetResponseHeader(respHeader *http.Header) Option

GetResponseHeader for get response http header

func IfMatch

func IfMatch(value string) Option

IfMatch is an option to set If-Match header

func IfModifiedSince

func IfModifiedSince(t time.Time) Option

IfModifiedSince is an option to set If-Modified-Since header

func IfNoneMatch

func IfNoneMatch(value string) Option

IfNoneMatch is an option to set IfNoneMatch header

func IfUnmodifiedSince

func IfUnmodifiedSince(t time.Time) Option

IfUnmodifiedSince is an option to set If-Unmodified-Since header

func InitCRC

func InitCRC(initCRC uint64) Option

InitCRC Init AppendObject CRC

func KeyMarker

func KeyMarker(value string) Option

KeyMarker is an option to set key-marker parameter

func ListType

func ListType(value int) Option

ListType is an option to set List-type parameter for ListObjectsV2

func Marker

func Marker(value string) Option

Marker is an option to set marker parameter

func MaxKeys

func MaxKeys(value int) Option

MaxKeys is an option to set maxkeys parameter

func MaxParts

func MaxParts(value int) Option

MaxParts is an option to set max-parts parameter

func MaxUploads

func MaxUploads(value int) Option

MaxUploads is an option to set max-uploads parameter

func Meta

func Meta(key, value string) Option

Meta is an option to set Meta header

func MetadataDirective

func MetadataDirective(directive MetadataDirectiveType) Option

MetadataDirective is an option to set X-Oss-Metadata-Directive header

func NormalizedRange

func NormalizedRange(nr string) Option

NormalizedRange is an option to set Range header, such as 1024-2048 or 1024- or -2048

func ObjectACL

func ObjectACL(acl ACLType) Option

ObjectACL is an option to set X-Oss-Object-Acl header

func ObjectHashFunc

func ObjectHashFunc(value ObjecthashFuncType) Option

RedundancyType bucket data redundancy type

func ObjectStorageClass

func ObjectStorageClass(storageClass StorageClassType) Option

ObjectStorageClass is an option to set the storage class of object

func Origin

func Origin(value string) Option

Origin is an option to set Origin header

func PartHashCtxHeader

func PartHashCtxHeader(value string) Option

func PartHashCtxParam

func PartHashCtxParam(value string) Option

func PartMd5CtxHeader

func PartMd5CtxHeader(value string) Option

func PartMd5CtxParam

func PartMd5CtxParam(value string) Option

func PartNumberMarker

func PartNumberMarker(value int) Option

PartNumberMarker is an option to set part-number-marker parameter

func Prefix

func Prefix(value string) Option

Prefix is an option to set prefix parameter

func Process

func Process(value string) Option

Process is an option to set x-oss-process param

func Progress

func Progress(listener ProgressListener) Option

Progress set progress listener

func Range

func Range(start, end int64) Option

Range is an option to set Range header, [start, end]

func RangeBehavior

func RangeBehavior(value string) Option

RangeBehavior is an option to set Range value, such as "standard"

func RedundancyType

func RedundancyType(value DataRedundancyType) Option

RedundancyType bucket data redundancy type

func RequestPayer

func RequestPayer(payerType PayerType) Option

RequestPayer is an option to set payer who pay for the request

func RequestPayerParam

func RequestPayerParam(payerType PayerType) Option

RequestPayerParam is an option to set payer who pay for the request

func ResponseCacheControl

func ResponseCacheControl(value string) Option

ResponseCacheControl is an option to set response-cache-control param

func ResponseContentDisposition

func ResponseContentDisposition(value string) Option

ResponseContentDisposition is an option to set response-content-disposition param

func ResponseContentEncoding

func ResponseContentEncoding(value string) Option

ResponseContentEncoding is an option to set response-content-encoding param

func ResponseContentLanguage

func ResponseContentLanguage(value string) Option

ResponseContentLanguage is an option to set response-content-language param

func ResponseContentType

func ResponseContentType(value string) Option

ResponseContentType is an option to set response-content-type param

func ResponseExpires

func ResponseExpires(value string) Option

ResponseExpires is an option to set response-expires param

func Routines

func Routines(n int) Option

Routines DownloadFile/UploadFile routine count

func SSECAlgorithm

func SSECAlgorithm(value string) Option

SSECAlgorithm is an option to set X-Oss-Server-Side-Encryption-Customer-Algorithm header

func SSECKey

func SSECKey(value string) Option

SSECKey is an option to set X-Oss-Server-Side-Encryption-Customer-Key header

func SSECKeyMd5

func SSECKeyMd5(value string) Option

SSECKeyMd5 is an option to set X-Oss-Server-Side-Encryption-Customer-Key-Md5 header

func Sequential

func Sequential() Option

Sequential is an option to set sequential parameter for InitiateMultipartUpload

func ServerSideDataEncryption

func ServerSideDataEncryption(value string) Option

ServerSideDataEncryption is an option to set X-Oss-Server-Side-Data-Encryption header

func ServerSideEncryption

func ServerSideEncryption(value string) Option

ServerSideEncryption is an option to set X-Oss-Server-Side-Encryption header

func ServerSideEncryptionKeyID

func ServerSideEncryptionKeyID(value string) Option

ServerSideEncryptionKeyID is an option to set X-Oss-Server-Side-Encryption-Key-Id header

func SetHeader

func SetHeader(key string, value interface{}) Option

SetHeader Allow users to set personalized http headers

func SetTagging

func SetTagging(tagging Tagging) Option

SetTagging is an option to set object tagging

func StartAfter

func StartAfter(value string) Option

StartAfter is an option to set start-after parameter for ListObjectsV2

func StorageClass

func StorageClass(value StorageClassType) Option

StorageClass bucket storage class

func TagKey

func TagKey(value string) Option

TagKey is an option to set tag key parameter

func TagValue

func TagValue(value string) Option

TagValue is an option to set tag value parameter

func TaggingDirective

func TaggingDirective(directive TaggingDirectiveType) Option

TaggingDirective is an option to set X-Oss-Metadata-Directive header

func TrafficLimitHeader

func TrafficLimitHeader(value int64) Option

TrafficLimitHeader is an option to set X-Oss-Traffic-Limit

func TrafficLimitParam

func TrafficLimitParam(value int64) Option

TrafficLimitParam is a option to set x-oss-traffic-limit

func UploadIDMarker

func UploadIDMarker(value string) Option

UploadIDMarker is an option to set upload-id-marker parameter

func UserAgentHeader

func UserAgentHeader(ua string) Option

UserAgentHeader is an option to set HTTPHeaderUserAgent

func VersionId

func VersionId(value string) Option

VersionId is an option to set versionId parameter

func VersionIdMarker

func VersionIdMarker(value string) Option

VersionIdMarker is an option to set version-id-marker parameter

func WithContext

func WithContext(ctx context.Context) Option

WithContext returns an option that sets the context for requests.

func WithHashContext

func WithHashContext() Option

WithHashContext is an option to set withHashContext parameter for InitiateMultipartUpload

type OptionalFields

type OptionalFields struct {
	XMLName xml.Name `xml:"OptionalFields,omitempty`
	Field   []string `xml:"Field,omitempty`
}

type OssLimiter

type OssLimiter struct {
	// contains filtered or unexported fields
}

OssLimiter wrapper rate.Limiter

func GetOssLimiter

func GetOssLimiter(uploadSpeed int) (ossLimiter *OssLimiter, err error)

GetOssLimiter create OssLimiter uploadSpeed KB/s

type OutputSerializationSelect

type OutputSerializationSelect struct {
	XMLName          xml.Name         `xml:"OutputSerialization"`
	CsvBodyOutput    CSVSelectOutput  `xml:CSV,omitempty`
	JsonBodyOutput   JSONSelectOutput `xml:JSON,omitempty`
	OutputRawData    *bool            `xml:"OutputRawData,omitempty"`
	KeepAllColumns   *bool            `xml:"KeepAllColumns,omitempty"`
	EnablePayloadCrc *bool            `xml:"EnablePayloadCrc,omitempty"`
	OutputHeader     *bool            `xml:"OutputHeader,omitempty"`
}

type Owner

type Owner struct {
	XMLName     xml.Name `xml:"Owner"`
	ID          string   `xml:"ID"`          // Owner ID
	DisplayName string   `xml:"DisplayName"` // Owner's display name
}

Owner defines Bucket/Object's owner

type PayerType

type PayerType string

PayerType the type of request payer

const (
	// Requester the requester who send the request
	Requester PayerType = "Requester"

	// BucketOwner the requester who send the request
	BucketOwner PayerType = "BucketOwner"
)

type PostSelectResult

type PostSelectResult struct {
	Response *SelectObjectResponse
}

PostSelectResult is the request of SelectObject

type ProcessObjectResult

type ProcessObjectResult struct {
	Bucket   string `json:"bucket"`
	FileSize int    `json:"fileSize"`
	Object   string `json:"object"`
	Status   string `json:"status"`
}

ProcessObjectResult defines result object of ProcessObject

type ProgressEvent

type ProgressEvent struct {
	ConsumedBytes int64
	TotalBytes    int64
	RwBytes       int64
	EventType     ProgressEventType
}

ProgressEvent defines progress event

type ProgressEventType

type ProgressEventType int

ProgressEventType defines transfer progress event type

const (
	// TransferStartedEvent transfer started, set TotalBytes
	TransferStartedEvent ProgressEventType = 1 + iota
	// TransferDataEvent transfer data, set ConsumedBytes and TotalBytes
	TransferDataEvent
	// TransferCompletedEvent transfer completed
	TransferCompletedEvent
	// TransferFailedEvent transfer encounters an error
	TransferFailedEvent
)

type ProgressListener

type ProgressListener interface {
	ProgressChanged(event *ProgressEvent)
}

ProgressListener listens progress change

func GetProgressListener

func GetProgressListener(options []Option) ProgressListener

GetProgressListener gets the progress callback

type PutBucketAccessMonitor

type PutBucketAccessMonitor BucketAccessMonitorXml

PutBucketAccessMonitor define the xml of bucket access monitor config

type PutBucketCORS

type PutBucketCORS CORSXML

PutBucketCORS defines the PutBucketCORS config xml.

type PutBucketCname

type PutBucketCname PutBucketCnameXml

type PutBucketCnameXml

type PutBucketCnameXml struct {
	XMLName                  xml.Name                  `xml:"BucketCnameConfiguration"`
	Cname                    string                    `xml:"Cname>Domain"`
	CertificateConfiguration *CertificateConfiguration `xml:"Cname>CertificateConfiguration"`
}

PutBucketCnameXml define cname configuration

type PutBucketRTC

type PutBucketRTC BucketRTCXml

PutBucketRTC define the bucket rtc config

type PutBucketReplication

type PutBucketReplication BucketReplicationXml

PutBucketReplication define the bucket replication config

type PutBucketResourceGroup

type PutBucketResourceGroup BucketResourceGroupXml

PutBucketResourceGroup define the xml of bucket's resource group config

type PutBucketResponseHeader

type PutBucketResponseHeader ResponseHeaderXml

PutBucketResponseHeader define the xml of bucket's response header config

type PutObjectRequest

type PutObjectRequest struct {
	ObjectKey string
	Reader    io.Reader
}

PutObjectRequest is the request of DoPutObject

type ReadFlagInfo

type ReadFlagInfo struct {
	OpenLine            bool
	ConsumedBytesLength int32
	EnablePayloadCrc    bool
	OutputRawData       bool
}

ReadFlagInfo if reading the frame data, recode the reading status

type Redirect

type Redirect struct {
	XMLName               xml.Name      `xml:"Redirect"`
	RedirectType          string        `xml:"RedirectType,omitempty"`         // The redirect type, it have Mirror,External,Internal,AliCDN
	PassQueryString       *bool         `xml:"PassQueryString"`                // Whether to send the specified request's parameters, true or false
	MirrorURL             string        `xml:"MirrorURL,omitempty"`            // Mirror of the website address back to the source.
	MirrorPassQueryString *bool         `xml:"MirrorPassQueryString"`          // To Mirror of the website Whether to send the specified request's parameters, true or false
	MirrorFollowRedirect  *bool         `xml:"MirrorFollowRedirect"`           // Redirect the location, if the mirror return 3XX
	MirrorCheckMd5        *bool         `xml:"MirrorCheckMd5"`                 // Check the mirror is MD5.
	MirrorHeaders         MirrorHeaders `xml:"MirrorHeaders,omitempty"`        // Mirror headers
	Protocol              string        `xml:"Protocol,omitempty"`             // The redirect Protocol
	HostName              string        `xml:"HostName,omitempty"`             // The redirect HostName
	ReplaceKeyPrefixWith  string        `xml:"ReplaceKeyPrefixWith,omitempty"` // object name'Prefix replace the value
	HttpRedirectCode      int           `xml:"HttpRedirectCode,omitempty"`     // THe redirect http code
	ReplaceKeyWith        string        `xml:"ReplaceKeyWith,omitempty"`       // object name replace the value
}

Redirect defines redirect in the RoutingRule

type RefererBlacklist

type RefererBlacklist struct {
	Referer []string `xml:"Referer,omitempty"`
}

type RefererXML

type RefererXML struct {
	XMLName                  xml.Name          `xml:"RefererConfiguration"`
	AllowEmptyReferer        bool              `xml:"AllowEmptyReferer"` // Allow empty referrer
	AllowTruncateQueryString *bool             `xml:"AllowTruncateQueryString,omitempty"`
	RefererList              []string          `xml:"RefererList>Referer"`        // Referer whitelist
	RefererBlacklist         *RefererBlacklist `xml:"RefererBlacklist,omitempty"` // Referer blacklist
}

RefererXML defines Referer configuration

type RegionInfo

type RegionInfo struct {
	Region             string `xml:"Region"`
	InternetEndpoint   string `xml:"InternetEndpoint"`
	InternalEndpoint   string `xml:"InternalEndpoint"`
	AccelerateEndpoint string `xml:"AccelerateEndpoint"`
}

type RegionInfoList

type RegionInfoList struct {
	XMLName xml.Name     `xml:"RegionInfoList"`
	Regions []RegionInfo `xml:"RegionInfo"`
}

type ReplicationLocation

type ReplicationLocation struct {
	Location string `xml:"Location,omitempty"`
}

type ReplicationLocationTransferType

type ReplicationLocationTransferType struct {
	Location      string `xml:"Location,omitempty"`
	TransferTypes string `xml:"TransferTypes>Type,omitempty"`
}

type ReplicationRule

type ReplicationRule struct {
	ID                          string                      `xml:"ID,omitempty"`
	RTC                         *string                     `xml:"RTC>Status,omitempty"`
	PrefixSet                   *ReplicationRulePrefix      `xml:"PrefixSet,omitempty"`
	Action                      string                      `xml:"Action,omitempty"`
	Destination                 *ReplicationRuleDestination `xml:"Destination,omitempty"`
	HistoricalObjectReplication string                      `xml:"HistoricalObjectReplication,omitempty"`
	Status                      string                      `xml:"Status,omitempty"`
	SyncRole                    string                      `xml:"SyncRole,omitempty"`
	SourceSelectionCriteria     *string                     `xml:"SourceSelectionCriteria>SseKmsEncryptedObjects>Status,omitempty"`
	EncryptionConfiguration     *string                     `xml:"EncryptionConfiguration>ReplicaKmsKeyID,omitempty"`
	Progress                    *ReplicationRuleProgress    `xml:"Progress,omitempty"`
	HistoricalObject            string                      `xml:"HistoricalObject,omitempty"`
}

ReplicationRule define the xml of bucket replication config rule

type ReplicationRuleDestination

type ReplicationRuleDestination struct {
	Bucket       string `xml:"Bucket,omitempty"`
	Location     string `xml:"Location,omitempty"`
	TransferType string `xml:"TransferType,omitempty"`
}

type ReplicationRulePrefix

type ReplicationRulePrefix struct {
	Prefix []*string `xml:"Prefix,omitempty"`
}

type ReplicationRuleProgress

type ReplicationRuleProgress struct {
	HistoricalObject string `xml:"HistoricalObject,omitempty"`
	NewObject        string `xml:"NewObject,omitempty"`
}

type ReplicationXML

type ReplicationXML struct {
	XMLName xml.Name `xml:"ReplicationRules"`
	ID      string   `xml:"ID,omitempty"`
}

ReplicationXML defines simple replication xml, and ReplicationXML is used for "DeleteBucketReplication" in client.go

type RequestPaymentConfiguration

type RequestPaymentConfiguration struct {
	XMLName xml.Name `xml:"RequestPaymentConfiguration"`
	Payer   string   `xml:"Payer,omitempty"`
}

RequestPaymentConfiguration define the request payment configuration

type Response

type Response struct {
	StatusCode int
	Headers    http.Header
	Body       io.ReadCloser
	ClientCRC  uint64
	ServerCRC  uint64
}

Response defines HTTP response from OSS

func (*Response) Close

func (r *Response) Close() error

Close close http reponse body

func (*Response) Read

func (r *Response) Read(p []byte) (n int, err error)

type ResponseHeaderRule

type ResponseHeaderRule struct {
	Name        string                    `xml:"Name"`                  // rule name
	Filters     ResponseHeaderRuleFilters `xml:"Filters,omitempty"`     // rule filters Operation
	HideHeaders ResponseHeaderRuleHeaders `xml:"HideHeaders,omitempty"` // rule hide header
}

type ResponseHeaderRuleFilters

type ResponseHeaderRuleFilters struct {
	Operation []string `xml:"Operation,omitempty"`
}

type ResponseHeaderRuleHeaders

type ResponseHeaderRuleHeaders struct {
	Header []string `xml:"Header,omitempty"`
}

type ResponseHeaderXml

type ResponseHeaderXml struct {
	XMLName xml.Name             `xml:"ResponseHeaderConfiguration"`
	Rule    []ResponseHeaderRule `xml:Rule,omitempty"` // rule
}

type RestoreConfiguration

type RestoreConfiguration struct {
	XMLName xml.Name `xml:"RestoreRequest"`
	Days    int32    `xml:"Days,omitempty"`
	Tier    string   `xml:"JobParameters>Tier,omitempty"`
}

RestoreConfiguration for RestoreObject

type RestoreMode

type RestoreMode string

RestoreMode the restore mode for coldArchive object

const (
	//RestoreExpedited object will be restored in 1 hour
	RestoreExpedited RestoreMode = "Expedited"

	//RestoreStandard object will be restored in 2-5 hours
	RestoreStandard RestoreMode = "Standard"

	//RestoreBulk object will be restored in 5-10 hours
	RestoreBulk RestoreMode = "Bulk"
)

type RoutingRule

type RoutingRule struct {
	XMLName    xml.Name  `xml:"RoutingRule"`
	RuleNumber int       `xml:"RuleNumber,omitempty"` // The routing number
	Condition  Condition `xml:"Condition,omitempty"`  // The routing condition
	Redirect   Redirect  `xml:"Redirect,omitempty"`   // The routing redirect

}

RoutingRule defines the routing rules

type SSEDefaultRule

type SSEDefaultRule struct {
	XMLName           xml.Name `xml:"ApplyServerSideEncryptionByDefault"`
	SSEAlgorithm      string   `xml:"SSEAlgorithm,omitempty"`
	KMSMasterKeyID    string   `xml:"KMSMasterKeyID,omitempty"`
	KMSDataEncryption string   `xml:"KMSDataEncryption,,omitempty"`
}

SSEDefaultRule Server Encryption deafult rule for the bucket

type SSERule

type SSERule struct {
	XMLName           xml.Name `xml:"ServerSideEncryptionRule"`    // Bucket ServerSideEncryptionRule
	KMSMasterKeyID    string   `xml:"KMSMasterKeyID,omitempty"`    // Bucket KMSMasterKeyID
	SSEAlgorithm      string   `xml:"SSEAlgorithm,omitempty"`      // Bucket SSEAlgorithm
	KMSDataEncryption string   `xml:"KMSDataEncryption,omitempty"` //Bucket KMSDataEncryption
}

type SelectObjectResponse

type SelectObjectResponse struct {
	StatusCode          int
	Headers             http.Header
	Body                io.ReadCloser
	Frame               SelectObjectResult
	ReadTimeOut         uint
	ClientCRC32         uint32
	ServerCRC32         uint32
	WriterForCheckCrc32 hash.Hash32
	Finish              bool
}

SelectObjectResponse defines HTTP response from OSS SelectObject

func (*SelectObjectResponse) Close

func (sr *SelectObjectResponse) Close() error

Close http reponse body

func (*SelectObjectResponse) Read

func (sr *SelectObjectResponse) Read(p []byte) (n int, err error)

type SelectObjectResult

type SelectObjectResult struct {
	Version          byte
	FrameType        int32
	PayloadLength    int32
	HeaderCheckSum   uint32
	Offset           uint64
	Data             string           // DataFrame
	EndFrame         EndFrame         // EndFrame
	MetaEndFrameCSV  MetaEndFrameCSV  // MetaEndFrameCSV
	MetaEndFrameJSON MetaEndFrameJSON // MetaEndFrameJSON
	PayloadChecksum  uint32
	ReadFlagInfo
}

SelectObjectResult is the SelectObject api's return

type SelectOptions

type SelectOptions struct {
	XMLName                  xml.Name `xml:"Options"`
	SkipPartialDataRecord    *bool    `xml:"SkipPartialDataRecord,omitempty"`
	MaxSkippedRecordsAllowed string   `xml:"MaxSkippedRecordsAllowed,omitempty"`
}

SelectOptions is a element in the SelectObject api request's params

type SelectRequest

type SelectRequest struct {
	XMLName                   xml.Name                  `xml:"SelectRequest"`
	Expression                string                    `xml:"Expression"`
	InputSerializationSelect  InputSerializationSelect  `xml:"InputSerialization"`
	OutputSerializationSelect OutputSerializationSelect `xml:"OutputSerialization"`
	SelectOptions             SelectOptions             `xml:"Options,omitempty"`
}

SelectRequest is for the SelectObject request params of json file

type ServerEncryptionRule

type ServerEncryptionRule struct {
	XMLName    xml.Name       `xml:"ServerSideEncryptionRule"`
	SSEDefault SSEDefaultRule `xml:"ApplyServerSideEncryptionByDefault"`
}

ServerEncryptionRule Server Encryption rule for the bucket

type ServiceError

type ServiceError struct {
	XMLName    xml.Name `xml:"Error"`
	Code       string   `xml:"Code"`      // The error code returned from OSS to the caller
	Message    string   `xml:"Message"`   // The detail error message from OSS
	RequestID  string   `xml:"RequestId"` // The UUID used to uniquely identify the request
	HostID     string   `xml:"HostId"`    // The OSS server cluster's Id
	Endpoint   string   `xml:"Endpoint"`
	Ec         string   `xml:"EC"`
	RawMessage string   // The raw messages from OSS
	StatusCode int      // HTTP status code

}

ServiceError contains fields of the error response from Oss Service REST API.

func (ServiceError) Error

func (e ServiceError) Error() string

Error implements interface error

type StorageClassType

type StorageClassType string

StorageClassType bucket storage type

const (
	// StorageStandard standard
	StorageStandard StorageClassType = "Standard"

	// StorageIA infrequent access
	StorageIA StorageClassType = "IA"

	// StorageArchive archive
	StorageArchive StorageClassType = "Archive"

	// StorageColdArchive cold archive
	StorageColdArchive StorageClassType = "ColdArchive"

	// StorageDeepColdArchive deep cold archive
	StorageDeepColdArchive StorageClassType = "DeepColdArchive"
)

type Tag

type Tag struct {
	XMLName xml.Name `xml:"Tag"`
	Key     string   `xml:"Key"`
	Value   string   `xml:"Value"`
}

Tag a tag for the object

type Tagging

type Tagging struct {
	XMLName xml.Name `xml:"Tagging"`
	Tags    []Tag    `xml:"TagSet>Tag,omitempty"`
}

Tagging tag set for the object

type TaggingDirectiveType

type TaggingDirectiveType string

TaggingDirectiveType specifying whether use the tagging of source object when copying object.

const (
	// TaggingCopy the target object's tagging is copied from the source one
	TaggingCopy TaggingDirectiveType = "COPY"

	// TaggingReplace the target object's tagging is created as part of the copy request (not same as the source one)
	TaggingReplace TaggingDirectiveType = "REPLACE"
)

type TransferAccConfiguration

type TransferAccConfiguration struct {
	XMLName xml.Name `xml:"TransferAccelerationConfiguration"`
	Enabled bool     `xml:"Enabled"`
}

TransferAccConfiguration define transfer acceleration configuration

type UncompletedUpload

type UncompletedUpload struct {
	XMLName   xml.Name  `xml:"Upload"`
	Key       string    `xml:"Key"`       // Object name
	UploadID  string    `xml:"UploadId"`  // The UploadId
	Initiated time.Time `xml:"Initiated"` // Initialization time in the format such as 2012-02-23T04:18:23.000Z
}

UncompletedUpload structure wraps an uncompleted upload task

type UnexpectedStatusCodeError

type UnexpectedStatusCodeError struct {
	// contains filtered or unexported fields
}

UnexpectedStatusCodeError is returned when a storage service responds with neither an error nor with an HTTP status code indicating success.

func (UnexpectedStatusCodeError) Error

Error implements interface error

func (UnexpectedStatusCodeError) Got

Got is the actual status code returned by oss.

type UnpackedRange

type UnpackedRange struct {
	HasStart bool  // Flag indicates if the start point is specified
	HasEnd   bool  // Flag indicates if the end point is specified
	Start    int64 // Start point
	End      int64 // End point
}

UnpackedRange

func GetRangeConfig

func GetRangeConfig(options []Option) (*UnpackedRange, error)

GetRangeConfig gets the download range from the options.

func ParseRange

func ParseRange(normalizedRange string) (*UnpackedRange, error)

ParseRange parse various styles of range such as bytes=M-N

type UploadPart

type UploadPart struct {
	XMLName    xml.Name `xml:"Part"`
	PartNumber int      `xml:"PartNumber"` // Part number
	ETag       string   `xml:"ETag"`       // ETag value of the part's data
}

UploadPart defines the upload/copy part

type UploadPartCopyResult

type UploadPartCopyResult struct {
	XMLName      xml.Name  `xml:"CopyPartResult"`
	LastModified time.Time `xml:"LastModified"` // Last modified time
	ETag         string    `xml:"ETag"`         // ETag
}

UploadPartCopyResult defines result object of multipart copy request.

type UploadPartRequest

type UploadPartRequest struct {
	InitResult *InitiateMultipartUploadResult
	Reader     io.Reader
	PartSize   int64
	PartNumber int
}

UploadPartRequest is the request of DoUploadPart

type UploadPartResult

type UploadPartResult struct {
	Part UploadPart
}

UploadPartResult is the result of DoUploadPart

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 UploadedPart

type UploadedPart struct {
	XMLName      xml.Name  `xml:"Part"`
	PartNumber   int       `xml:"PartNumber"`   // Part number
	LastModified time.Time `xml:"LastModified"` // Last modified time
	ETag         string    `xml:"ETag"`         // ETag cache
	Size         int       `xml:"Size"`         // Part size
}

UploadedPart defines uploaded part

type UserQoSConfiguration

type UserQoSConfiguration struct {
	XMLName xml.Name `xml:"QoSConfiguration"`
	Region  string   `xml:"Region,omitempty"` // Effective area of Qos configuration
	BucketQoSConfiguration
}

UserQoSConfiguration define QoS and Range configuration

type VersioningConfig

type VersioningConfig struct {
	XMLName xml.Name `xml:"VersioningConfiguration"`
	Status  string   `xml:"Status"`
}

VersioningConfig for the bucket

type VersioningStatus

type VersioningStatus string

bucket versioning status

const (
	// Versioning Status definition: Enabled
	VersionEnabled VersioningStatus = "Enabled"

	// Versioning Status definition: Suspended
	VersionSuspended VersioningStatus = "Suspended"
)

type WebsiteXML

type WebsiteXML struct {
	XMLName       xml.Name      `xml:"WebsiteConfiguration"`
	IndexDocument IndexDocument `xml:"IndexDocument,omitempty"`            // The index page
	ErrorDocument ErrorDocument `xml:"ErrorDocument,omitempty"`            // The error page
	RoutingRules  []RoutingRule `xml:"RoutingRules>RoutingRule,omitempty"` // The routing Rule list
}

WebsiteXML defines Website configuration

type WormConfiguration

type WormConfiguration struct {
	XMLName               xml.Name `xml:"WormConfiguration"`
	WormId                string   `xml:"WormId,omitempty"`
	State                 string   `xml:"State,omitempty"`
	RetentionPeriodInDays int      `xml:"RetentionPeriodInDays"` // specify retention days
	CreationDate          string   `xml:"CreationDate,omitempty"`
}

WormConfiguration define WormConfiguration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL