aliyun-oss-go-sdk: github.com/aliyun/aliyun-oss-go-sdk/oss Index | Files

package oss

import "github.com/aliyun/aliyun-oss-go-sdk/oss"

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

Index

Package Files

auth.go bucket.go client.go conf.go conn.go const.go crc.go download.go error.go limit_reader_1_7.go livechannel.go mime.go model.go multicopy.go multipart.go option.go progress.go select_object.go select_object_type.go transport_1_7.go type.go upload.go utils.go

Constants

const (
    LogOff = iota
    Error
    Warn
    Info
    Debug
)

Define the level of the output log

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"
    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"
)

HTTP headers

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

HTTP Param

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"

    Version = "v2.0.4" // Go SDK version
)

Other constants

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

FrameType

Variables

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

LogTag Tag for each level of log

func CRC64Combine Uses

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

CRC64Combine combines CRC64

func CheckBucketName Uses

func CheckBucketName(bucketName string) error

func GetCopySrcVersionId Uses

func GetCopySrcVersionId(header http.Header) string

func GetDeleteMark Uses

func GetDeleteMark(header http.Header) bool

func GetNowGMT Uses

func GetNowGMT() string

GetNowGMT gets the current time in GMT format.

func GetNowNanoSec Uses

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 Uses

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 Uses

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

GetPartEnd calculates the end position

func GetQosDelayTime Uses

func GetQosDelayTime(header http.Header) string

func GetRequestId Uses

func GetRequestId(header http.Header) string

func GetVersionId Uses

func GetVersionId(header http.Header) string

func NewCRC Uses

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 Uses

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 Uses

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

type ACLType Uses

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 Uses

type AlgorithmType string

AlgorithmType specifying the server side encryption algorithm name

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

type AppendObjectRequest Uses

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

AppendObjectRequest is the requtest of DoAppendObject

type AppendObjectResult Uses

type AppendObjectResult struct {
    NextPosition int64
    CRC          uint64
}

AppendObjectResult is the result of DoAppendObject

type Bucket Uses

type Bucket struct {
    Client     Client
    BucketName string
}

Bucket implements the operations of object.

func (Bucket) AbortMultipartUpload Uses

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 Uses

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) CompleteMultipartUpload Uses

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/object/CopyObject.html

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

func (Bucket) CopyObjectFrom Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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) DeleteObject Uses

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 Uses

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 Uses

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 Uses

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) DoAppendObject Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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) GetLiveChannelHistory Uses

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 Uses

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/object/GetObject.html

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/object/HeadObject.html

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

func (Bucket) GetObjectMeta Uses

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 Uses

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

func (Bucket) GetObjectToFile Uses

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/object/GetObject.html

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/InitiateMultipartUpload.html

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 Uses

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 Uses

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 Uses

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 Uses

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

ListObjectVersions lists objects of all versions under the current bucket.

func (Bucket) ListObjects Uses

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.

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

func (Bucket) ListUploadedParts Uses

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 Uses

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

func (Bucket) PostVodPlaylist Uses

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 Uses

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/object/PutObject.html

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

func (Bucket) PutObjectFromFile Uses

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 Uses

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/object/PutObject.html

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 Uses

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) SelectObject Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/UploadPartCopy.html

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 Uses

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 BucketInfo Uses

type BucketInfo struct {
    XMLName          xml.Name  `xml:"Bucket"`
    Name             string    `xml:"Name"`                     // Bucket name
    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
}

BucketInfo defines Bucket information

type BucketProperties Uses

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
}

BucketProperties defines bucket properties

type BucketQoSConfiguration Uses

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 BucketStat Uses

type BucketStat struct {
    XMLName              xml.Name `xml:"BucketStat"`
    Storage              int64    `xml:"Storage"`
    ObjectCount          int64    `xml:"ObjectCount"`
    MultipartUploadCount int64    `xml:"MultipartUploadCount"`
}

type CORSRule Uses

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 Uses

type CORSXML struct {
    XMLName   xml.Name   `xml:"CORSConfiguration"`
    CORSRules []CORSRule `xml:"CORSRule"` // CORS rules
}

CORSXML defines CORS configuration

type CRCCheckError Uses

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

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

func (CRCCheckError) Error Uses

func (e CRCCheckError) Error() string

Error implements interface error

type CSV Uses

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 Uses

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 Uses

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

type Client Uses

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 Uses

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) Bucket Uses

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) CreateBucket Uses

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) DeleteBucket Uses

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 Uses

func (client Client) DeleteBucketCORS(bucketName string) 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) DeleteBucketEncryption Uses

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) DeleteBucketLifecycle Uses

func (client Client) DeleteBucketLifecycle(bucketName string) 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 Uses

func (client Client) DeleteBucketLogging(bucketName string) 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 Uses

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 Uses

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

DeleteBucketQosInfo API operation for Object Storage Service.

Delete Bucket QoS information.

bucketName tht bucket name.

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

func (Client) DeleteBucketTagging Uses

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) DeleteBucketWebsite Uses

func (client Client) DeleteBucketWebsite(bucketName string) 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) GetBucketACL Uses

func (client Client) GetBucketACL(bucketName string) (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) GetBucketCORS Uses

func (client Client) GetBucketCORS(bucketName string) (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) GetBucketEncryption Uses

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 Uses

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) GetBucketLifecycle Uses

func (client Client) GetBucketLifecycle(bucketName string) (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) GetBucketLocation Uses

func (client Client) GetBucketLocation(bucketName string) (string, error)

GetBucketLocation gets the bucket location.

Checks out the following link for more information : https://help.aliyun.com/document_detail/oss/user_guide/oss_concept/endpoint.html

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 Uses

func (client Client) GetBucketLogging(bucketName string) (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 Uses

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 Uses

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

GetBucketQosInfo API operation for Object Storage Service.

Get Bucket Qos information.

bucketName tht bucket name.

BucketQoSConfiguration the return qos configuration.

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

func (Client) GetBucketReferer Uses

func (client Client) GetBucketReferer(bucketName string) (GetBucketRefererResult, error)

GetBucketReferer gets the bucket's referrer white list.

bucketName the bucket name.

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) GetBucketRequestPayment Uses

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) GetBucketStat Uses

func (client Client) GetBucketStat(bucketName string) (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) GetBucketTagging Uses

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) GetBucketVersioning Uses

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 Uses

func (client Client) GetBucketWebsite(bucketName string) (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) GetUserQoSInfo Uses

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) IsBucketExist Uses

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) LimitUploadSpeed Uses

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) ListBuckets Uses

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) SetBucketACL Uses

func (client Client) SetBucketACL(bucketName string, bucketACL ACLType) 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) SetBucketCORS Uses

func (client Client) SetBucketCORS(bucketName string, corsRules []CORSRule) 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) SetBucketEncryption Uses

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) SetBucketLifecycle Uses

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

SetBucketLifecycle sets the bucket's lifecycle.

For more information, checks out following link: https://help.aliyun.com/document_detail/oss/user_guide/manage_object/object_lifecycle.html

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) SetBucketLogging Uses

func (client Client) SetBucketLogging(bucketName, targetBucket, targetPrefix string,
    isEnable bool) 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://help.aliyun.com/document_detail/oss/user_guide/security_management/logging.html

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 Uses

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 Uses

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

SetBucketQoSInfo API operation for Object Storage Service.

Set Bucket Qos information.

bucketName tht bucket name.

qosConf the qos configuration.

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

func (Client) SetBucketReferer Uses

func (client Client) SetBucketReferer(bucketName string, referers []string, allowEmptyReferer bool) 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 webbrowser 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://help.aliyun.com/document_detail/oss/user_guide/security_management/referer.html

bucketName the bucket name. referers 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) SetBucketRequestPayment Uses

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 Uses

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) SetBucketVersioning Uses

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 Uses

func (client Client) SetBucketWebsite(bucketName, indexDocument, errorDocument string) 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://help.aliyun.com/document_detail/oss/user_guide/static_host_website.html

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 Uses

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://help.aliyun.com/document_detail/oss/user_guide/static_host_website.html

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.

type ClientOption Uses

type ClientOption func(*Client)

ClientOption client option such as UseCname, Timeout, SecurityToken.

func AuthProxy Uses

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 EnableCRC Uses

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 Uses

func EnableMD5(isEnableMD5 bool) ClientOption

EnableMD5 enables MD5 validation.

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

func HTTPClient Uses

func HTTPClient(HTTPClient *http.Client) ClientOption

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

func MD5ThresholdCalcInMemory Uses

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 Proxy Uses

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 SecurityToken Uses

func SecurityToken(token string) ClientOption

SecurityToken sets the temporary user's SecurityToken.

token STS token

func SetCredentialsProvider Uses

func SetCredentialsProvider(provider CredentialsProvider) ClientOption

SetCredentialsProvider sets funciton for get the user's ak

func SetLocalAddr Uses

func SetLocalAddr(localAddr net.Addr) ClientOption

SetLocalAddr sets funciton for local addr

func SetLogLevel Uses

func SetLogLevel(LogLevel int) ClientOption

SetLogLevel sets the oss sdk log level

func SetLogger Uses

func SetLogger(Logger *log.Logger) ClientOption

SetLogger sets the oss sdk logger

func Timeout Uses

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 Uses

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 Uses

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.

type CompleteMultipartUploadResult Uses

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 Uses

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 Uses

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.
    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
    CredentialsProvider CredentialsProvider // User provides interface to get AccessKeyID, AccessKeySecret, SecurityToken
    LocalAddr           net.Addr            // local client host info
}

Config defines oss configuration

func (*Config) GetCredentials Uses

func (config *Config) GetCredentials() Credentials

for get Credentials

func (*Config) LimitUploadSpeed Uses

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

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

func (*Config) WriteLog Uses

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

WriteLog output log function

type Conn Uses

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

Conn defines OSS Conn

func (Conn) Do Uses

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 Uses

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) LoggerHTTPReq Uses

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

LoggerHTTPReq Print the header information of the http request

func (Conn) LoggerHTTPResp Uses

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

LoggerHTTPResp Print Response to http request

type CopyObjectResult Uses

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 CreateLiveChannelResult Uses

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 Uses

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

CredentialInf is interface for get AccessKeyID,AccessKeySecret,SecurityToken

type CredentialsProvider Uses

type CredentialsProvider interface {
    GetCredentials() Credentials
}

CredentialInfBuild is interface for get CredentialInf

type CsvMetaRequest Uses

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

type DataRedundancyType Uses

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 Uses

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 Uses

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

DeleteObjectsResult_inner defines result of DeleteObjects request

type DeleteObjectsResult Uses

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

DeleteObjectsResult defines result of DeleteObjects request

type DeletedKeyInfo Uses

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
}

DeleteKeyInfo defines object delete info

type EndFrame Uses

type EndFrame struct {
    TotalScanned   int64
    HTTPStatusCode int32
    ErrorMsg       string
}

EndFrame is EndFrameType of SelectObject api

type ErrorDocument Uses

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

ErrorDocument defines the 404 error page info

type FileChunk Uses

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

FileChunk is the file chunk definition

func SplitFileByPartNum Uses

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 Uses

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 Uses

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 GetBucketCORSResult Uses

type GetBucketCORSResult CORSXML

GetBucketCORSResult defines the result from GetBucketCORS request.

type GetBucketEncryptionResult Uses

type GetBucketEncryptionResult ServerEncryptionRule

type GetBucketInfoResult Uses

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

GetBucketInfoResult defines the result from GetBucketInfo request.

type GetBucketLifecycleResult Uses

type GetBucketLifecycleResult LifecycleConfiguration

GetBucketLifecycleResult defines GetBucketLifecycle's result object

type GetBucketLoggingResult Uses

type GetBucketLoggingResult LoggingXML

GetBucketLoggingResult defines the result from GetBucketLogging request

type GetBucketRefererResult Uses

type GetBucketRefererResult RefererXML

GetBucketRefererResult defines result object for GetBucketReferer request

type GetBucketStatResult Uses

type GetBucketStatResult BucketStat

type GetBucketTaggingResult Uses

type GetBucketTaggingResult Tagging

type GetBucketVersioningResult Uses

type GetBucketVersioningResult VersioningConfig

type GetBucketWebsiteResult Uses

type GetBucketWebsiteResult WebsiteXML

GetBucketWebsiteResult defines the result from GetBucketWebsite request.

type GetObjectACLResult Uses

type GetObjectACLResult GetBucketACLResult

GetObjectACLResult defines result of GetObjectACL request

type GetObjectRequest Uses

type GetObjectRequest struct {
    ObjectKey string
}

GetObjectRequest is the request of DoGetObject

type GetObjectResult Uses

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

GetObjectResult is the result of DoGetObject

type GetObjectTaggingResult Uses

type GetObjectTaggingResult Tagging

for GetObjectTagging return value

type HTTPMaxConns Uses

type HTTPMaxConns struct {
    MaxIdleConns        int
    MaxIdleConnsPerHost int
}

HTTPMaxConns defines max idle connections and max idle connections per host

type HTTPMethod Uses

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 Uses

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

HTTPTimeout defines HTTP timeout.

type IncludeHeader Uses

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 Uses

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 Uses

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 InputSerialization Uses

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 Uses

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

type JSON Uses

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

type JSONSelectInput Uses

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 Uses

func (jsonInput *JSONSelectInput) JsonIsEmpty() bool

type JSONSelectOutput Uses

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

type JsonMetaRequest Uses

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

type LifecycleAbortMultipartUpload Uses

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 Uses

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

LifecycleConfiguration is the Bucket Lifecycle configuration

type LifecycleExpiration Uses

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 LifecycleRule Uses

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"`
    NonVersionTransition *LifecycleVersionTransition    `xml:"NoncurrentVersionTransition,omitempty"`
}

LifecycleRule defines Lifecycle rules

func BuildLifecycleRuleByDate Uses

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 Uses

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 Uses

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
}

LifecycleTransition defines the rule's transition propery

type LifecycleVersionExpiration Uses

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 Uses

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"`
}

LifecycleVersionTransition defines the rule's NoncurrentVersionTransition propery

type LimitSpeedReader Uses

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

LimitSpeedReader for limit bandwidth upload

func (*LimitSpeedReader) Close Uses

func (r *LimitSpeedReader) Close() error

Close ...

func (*LimitSpeedReader) Read Uses

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

Read

type ListBucketsResult Uses

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 ListLiveChannelResult Uses

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 Uses

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 Uses

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 Uses

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 ListUploadedPartsResult Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

LoggingXML defines logging configuration

type MetaEndFrameCSV Uses

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

MetaEndFrameCSV is MetaEndFrameCSVType of CreateSelectObjectMeta

type MetaEndFrameJSON Uses

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

MetaEndFrameJSON is MetaEndFrameJSON of CreateSelectObjectMeta

type MetadataDirectiveType Uses

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 Uses

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 Uses

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 ObjectDeleteMarkerProperties Uses

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 Uses

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)
}

ObjectProperties defines Objecct properties

type ObjectVersionProperties Uses

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
}

type Option Uses

type Option func(map[string]optionValue) error

Option HTTP option

func ACL Uses

func ACL(acl ACLType) Option

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

func ACReqHeaders Uses

func ACReqHeaders(value string) Option

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

func ACReqMethod Uses

func ACReqMethod(value string) Option

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

func AcceptEncoding Uses

func AcceptEncoding(value string) Option

AcceptEncoding is an option to set Accept-Encoding header

func CacheControl Uses

func CacheControl(value string) Option

CacheControl is an option to set Cache-Control header

func Callback Uses

func Callback(callback string) Option

Callback is an option to set callback values

func CallbackVar Uses

func CallbackVar(callbackVar string) Option

CallbackVar is an option to set callback user defined values

func Checkpoint Uses

func Checkpoint(isEnable bool, filePath string) Option

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

func CheckpointDir Uses

func CheckpointDir(isEnable bool, dirPath string) Option

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

func ChoiceAbortPartOption Uses

func ChoiceAbortPartOption(options []Option) []Option

ChoiceAbortPartOption choices valid option supported by AbortMultipartUpload

func ChoiceCompletePartOption Uses

func ChoiceCompletePartOption(options []Option) []Option

ChoiceCompletePartOption choices valid option supported by CompleteMulitiPart

func ChoiceHeadObjectOption Uses

func ChoiceHeadObjectOption(options []Option) []Option

ChoiceHeadObjectOption choices valid option supported by HeadObject

func ChoiceTransferPartOption Uses

func ChoiceTransferPartOption(options []Option) []Option

choiceTransferPartOption choices valid option supported by Uploadpart or DownloadPart

func ContentDisposition Uses

func ContentDisposition(value string) Option

ContentDisposition is an option to set Content-Disposition header

func ContentEncoding Uses

func ContentEncoding(value string) Option

ContentEncoding is an option to set Content-Encoding header

func ContentLanguage Uses

func ContentLanguage(value string) Option

ContentLanguage is an option to set Content-Language header

func ContentLength Uses

func ContentLength(length int64) Option

ContentLength is an option to set Content-Length header

func ContentMD5 Uses

func ContentMD5(value string) Option

ContentMD5 is an option to set Content-MD5 header

func ContentType Uses

func ContentType(value string) Option

ContentType is an option to set Content-Type header

func CopySource Uses

func CopySource(sourceBucket, sourceObject string) Option

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

func CopySourceIfMatch Uses

func CopySourceIfMatch(value string) Option

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

func CopySourceIfModifiedSince Uses

func CopySourceIfModifiedSince(t time.Time) Option

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

func CopySourceIfNoneMatch Uses

func CopySourceIfNoneMatch(value string) Option

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

func CopySourceIfUnmodifiedSince Uses

func CopySourceIfUnmodifiedSince(t time.Time) Option

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

func CopySourceRange Uses

func CopySourceRange(startPosition, partSize int64) Option

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

func CopySourceVersion Uses

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

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

func DeleteObjectsQuiet Uses

func DeleteObjectsQuiet(isQuiet bool) Option

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

func Delimiter Uses

func Delimiter(value string) Option

Delimiter is an option to set delimiler parameter

func EncodingType Uses

func EncodingType(value string) Option

EncodingType is an option to set encoding-type parameter

func Expires Uses

func Expires(t time.Time) Option

Expires is an option to set Expires header

func GetResponseHeader Uses

func GetResponseHeader(respHeader *http.Header) Option

GetResponseHeader for get response http header

func IfMatch Uses

func IfMatch(value string) Option

IfMatch is an option to set If-Match header

func IfModifiedSince Uses

func IfModifiedSince(t time.Time) Option

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

func IfNoneMatch Uses

func IfNoneMatch(value string) Option

IfNoneMatch is an option to set IfNoneMatch header

func IfUnmodifiedSince Uses

func IfUnmodifiedSince(t time.Time) Option

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

func InitCRC Uses

func InitCRC(initCRC uint64) Option

InitCRC Init AppendObject CRC

func KeyMarker Uses

func KeyMarker(value string) Option

KeyMarker is an option to set key-marker parameter

func Marker Uses

func Marker(value string) Option

Marker is an option to set marker parameter

func MaxKeys Uses

func MaxKeys(value int) Option

MaxKeys is an option to set maxkeys parameter

func MaxParts Uses

func MaxParts(value int) Option

MaxParts is an option to set max-parts parameter

func MaxUploads Uses

func MaxUploads(value int) Option

MaxUploads is an option to set max-uploads parameter

func Meta Uses

func Meta(key, value string) Option

Meta is an option to set Meta header

func MetadataDirective Uses

func MetadataDirective(directive MetadataDirectiveType) Option

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

func NormalizedRange Uses

func NormalizedRange(nr string) Option

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

func ObjectACL Uses

func ObjectACL(acl ACLType) Option

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

func ObjectStorageClass Uses

func ObjectStorageClass(storageClass StorageClassType) Option

ObjectStorageClass is an option to set the storage class of object

func Origin Uses

func Origin(value string) Option

Origin is an option to set Origin header

func PartNumberMarker Uses

func PartNumberMarker(value int) Option

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

func Prefix Uses

func Prefix(value string) Option

Prefix is an option to set prefix parameter

func Process Uses

func Process(value string) Option

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

func Progress Uses

func Progress(listener ProgressListener) Option

Progress set progress listener

func Range Uses

func Range(start, end int64) Option

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

func RedundancyType Uses

func RedundancyType(value DataRedundancyType) Option

RedundancyType bucket data redundancy type

func RequestPayer Uses

func RequestPayer(payerType PayerType) Option

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

func ResponseCacheControl Uses

func ResponseCacheControl(value string) Option

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

func ResponseContentDisposition Uses

func ResponseContentDisposition(value string) Option

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

func ResponseContentEncoding Uses

func ResponseContentEncoding(value string) Option

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

func ResponseContentLanguage Uses

func ResponseContentLanguage(value string) Option

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

func ResponseContentType Uses

func ResponseContentType(value string) Option

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

func ResponseExpires Uses

func ResponseExpires(value string) Option

ResponseExpires is an option to set response-expires param

func Routines Uses

func Routines(n int) Option

Routines DownloadFile/UploadFile routine count

func ServerSideEncryption Uses

func ServerSideEncryption(value string) Option

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

func ServerSideEncryptionKeyID Uses

func ServerSideEncryptionKeyID(value string) Option

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

func SetTagging Uses

func SetTagging(tagging Tagging) Option

SetTagging is an option to set object tagging

func StorageClass Uses

func StorageClass(value StorageClassType) Option

StorageClass bucket storage class

func TagKey Uses

func TagKey(value string) Option

TagKey is an option to set tag key parameter

func TagValue Uses

func TagValue(value string) Option

TagValue is an option to set tag value parameter

func TaggingDirective Uses

func TaggingDirective(directive TaggingDirectiveType) Option

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

func TrafficLimitHeader Uses

func TrafficLimitHeader(value int64) Option

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

func TrafficLimitParam Uses

func TrafficLimitParam(value int64) Option

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

func UploadIDMarker Uses

func UploadIDMarker(value string) Option

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

func VersionId Uses

func VersionId(value string) Option

VersionId is an option to set versionId parameter

func VersionIdMarker Uses

func VersionIdMarker(value string) Option

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

type OssLimiter Uses

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

OssLimiter wrapper rate.Limiter

func GetOssLimiter Uses

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

GetOssLimiter create OssLimiter uploadSpeed KB/s

type OutputSerializationSelect Uses

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 Uses

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 Uses

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 Uses

type PostSelectResult struct {
    Response *SelectObjectResponse
}

PostSelectResult is the request of SelectObject

type ProcessObjectResult Uses

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 Uses

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

ProgressEvent defines progress event

type ProgressEventType Uses

type ProgressEventType int

ProgressEventType defines transfer progress event type

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

type ProgressListener Uses

type ProgressListener interface {
    ProgressChanged(event *ProgressEvent)
}

ProgressListener listens progress change

type PutObjectRequest Uses

type PutObjectRequest struct {
    ObjectKey string
    Reader    io.Reader
}

PutObjectRequest is the request of DoPutObject

type ReadFlagInfo Uses

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

ReadFlagInfo if reading the frame data, recode the reading status

type Redirect Uses

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 RefererXML Uses

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

RefererXML defines Referer configuration

type RequestPaymentConfiguration Uses

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

RequestPaymentConfiguration define the request payment configuration

type Response Uses

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

Response defines HTTP response from OSS

func (*Response) Close Uses

func (r *Response) Close() error

Close close http reponse body

func (*Response) Read Uses

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

type RoutingRule Uses

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 Uses

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

Server Encryption deafult rule for the bucket

type SSERule Uses

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

type SelectObjectResponse Uses

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 Uses

func (sr *SelectObjectResponse) Close() error

Close http reponse body

func (*SelectObjectResponse) Read Uses

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

type SelectObjectResult Uses

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 Uses

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

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

type SelectRequest Uses

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 Uses

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

Server Encryption rule for the bucket

type ServiceError Uses

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"`
    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 Uses

func (e ServiceError) Error() string

Error implements interface error

type StorageClassType Uses

type StorageClassType string

StorageClassType bucket storage type

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

    // StorageIA infrequent access
    StorageIA StorageClassType = "IA"

    // StorageArchive archive
    StorageArchive StorageClassType = "Archive"
)

type Tag Uses

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

Tag a tag for the object

type Tagging Uses

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

Tagging tagset for the object

type TaggingDirectiveType Uses

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 UncompletedUpload Uses

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 Uses

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 Uses

func (e UnexpectedStatusCodeError) Error() string

Error implements interface error

func (UnexpectedStatusCodeError) Got Uses

func (e UnexpectedStatusCodeError) Got() int

Got is the actual status code returned by oss.

type UploadPart Uses

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 Uses

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 Uses

type UploadPartRequest struct {
    InitResult *InitiateMultipartUploadResult
    Reader     io.Reader
    PartSize   int64
    PartNumber int
}

UploadPartRequest is the request of DoUploadPart

type UploadPartResult Uses

type UploadPartResult struct {
    Part UploadPart
}

UploadPartResult is the result of DoUploadPart

type UploadedPart Uses

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 Uses

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 Uses

type VersioningConfig struct {
    XMLName xml.Name `xml:"VersioningConfiguration"`
    Status  string   `xml:"Status"`
}

VersioningConfig for the bucket

type VersioningStatus Uses

type VersioningStatus string

bucket versioning status

const (
    // Versioning Status definition: Enabled
    VersionEnabled VersioningStatus = "Enabled"

    // Versioning Status definition: Suspended
    VersionSuspended VersioningStatus = "Suspended"
)

type WebsiteXML Uses

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

Package oss imports 32 packages (graph) and is imported by 65 packages. Updated 2019-11-13. Refresh now. Tools for package owners.