obs

package
v0.5.27 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 34 Imported by: 3

Documentation

Index

Constants

View Source
const (
	USER_AGENT             = "obs-sdk-go/" + obs_sdk_version
	HEADER_PREFIX          = "x-amz-"
	HEADER_PREFIX_META     = "x-amz-meta-"
	HEADER_PREFIX_OBS      = "x-obs-"
	HEADER_PREFIX_META_OBS = "x-obs-meta-"
	HEADER_DATE_AMZ        = "x-amz-date"
	HEADER_DATE_OBS        = "x-obs-date"
	HEADER_STS_TOKEN_AMZ   = "x-amz-security-token"
	HEADER_STS_TOKEN_OBS   = "x-obs-security-token"
	HEADER_ACCESSS_KEY_AMZ = "AWSAccessKeyId"
	PREFIX_META            = "meta-"

	HEADER_CONTENT_SHA256_AMZ               = "x-amz-content-sha256"
	HEADER_ACL_AMZ                          = "x-amz-acl"
	HEADER_ACL_OBS                          = "x-obs-acl"
	HEADER_ACL                              = "acl"
	HEADER_LOCATION_AMZ                     = "location"
	HEADER_BUCKET_LOCATION_OBS              = "bucket-location"
	HEADER_COPY_SOURCE                      = "copy-source"
	HEADER_COPY_SOURCE_RANGE                = "copy-source-range"
	HEADER_RANGE                            = "Range"
	HEADER_STORAGE_CLASS                    = "x-default-storage-class"
	HEADER_STORAGE_CLASS_OBS                = "x-obs-storage-class"
	HEADER_VERSION_OBS                      = "version"
	HEADER_GRANT_READ_OBS                   = "grant-read"
	HEADER_GRANT_WRITE_OBS                  = "grant-write"
	HEADER_GRANT_READ_ACP_OBS               = "grant-read-acp"
	HEADER_GRANT_WRITE_ACP_OBS              = "grant-write-acp"
	HEADER_GRANT_FULL_CONTROL_OBS           = "grant-full-control"
	HEADER_GRANT_READ_DELIVERED_OBS         = "grant-read-delivered"
	HEADER_GRANT_FULL_CONTROL_DELIVERED_OBS = "grant-full-control-delivered"
	HEADER_REQUEST_ID                       = "request-id"
	HEADER_BUCKET_REGION                    = "bucket-region"
	HEADER_ACCESS_CONRTOL_ALLOW_ORIGIN      = "access-control-allow-origin"
	HEADER_ACCESS_CONRTOL_ALLOW_HEADERS     = "access-control-allow-headers"
	HEADER_ACCESS_CONRTOL_MAX_AGE           = "access-control-max-age"
	HEADER_ACCESS_CONRTOL_ALLOW_METHODS     = "access-control-allow-methods"
	HEADER_ACCESS_CONRTOL_EXPOSE_HEADERS    = "access-control-expose-headers"
	HEADER_EPID_HEADERS                     = "epid"
	HEADER_VERSION_ID                       = "version-id"
	HEADER_COPY_SOURCE_VERSION_ID           = "copy-source-version-id"
	HEADER_DELETE_MARKER                    = "delete-marker"
	HEADER_WEBSITE_REDIRECT_LOCATION        = "website-redirect-location"
	HEADER_METADATA_DIRECTIVE               = "metadata-directive"
	HEADER_EXPIRATION                       = "expiration"
	HEADER_EXPIRES_OBS                      = "x-obs-expires"
	HEADER_RESTORE                          = "restore"
	HEADER_OBJECT_TYPE                      = "object-type"
	HEADER_NEXT_APPEND_POSITION             = "next-append-position"
	HEADER_STORAGE_CLASS2                   = "storage-class"
	HEADER_CONTENT_LENGTH                   = "content-length"
	HEADER_CONTENT_TYPE                     = "content-type"
	HEADER_CONTENT_LANGUAGE                 = "content-language"
	HEADER_EXPIRES                          = "expires"
	HEADER_CACHE_CONTROL                    = "cache-control"
	HEADER_CONTENT_DISPOSITION              = "content-disposition"
	HEADER_CONTENT_ENCODING                 = "content-encoding"
	HEADER_BUCKET_TYPE                      = "bucket-type"

	HEADER_ETAG         = "etag"
	HEADER_LASTMODIFIED = "last-modified"

	HEADER_COPY_SOURCE_IF_MATCH            = "copy-source-if-match"
	HEADER_COPY_SOURCE_IF_NONE_MATCH       = "copy-source-if-none-match"
	HEADER_COPY_SOURCE_IF_MODIFIED_SINCE   = "copy-source-if-modified-since"
	HEADER_COPY_SOURCE_IF_UNMODIFIED_SINCE = "copy-source-if-unmodified-since"

	HEADER_IF_MATCH            = "If-Match"
	HEADER_IF_NONE_MATCH       = "If-None-Match"
	HEADER_IF_MODIFIED_SINCE   = "If-Modified-Since"
	HEADER_IF_UNMODIFIED_SINCE = "If-Unmodified-Since"

	HEADER_SSEC_ENCRYPTION = "server-side-encryption-customer-algorithm"
	HEADER_SSEC_KEY        = "server-side-encryption-customer-key"
	HEADER_SSEC_KEY_MD5    = "server-side-encryption-customer-key-MD5"

	HEADER_SSEKMS_ENCRYPTION      = "server-side-encryption"
	HEADER_SSEKMS_KEY             = "server-side-encryption-aws-kms-key-id"
	HEADER_SSEKMS_ENCRYPT_KEY_OBS = "server-side-encryption-kms-key-id"

	HEADER_SSEC_COPY_SOURCE_ENCRYPTION = "copy-source-server-side-encryption-customer-algorithm"
	HEADER_SSEC_COPY_SOURCE_KEY        = "copy-source-server-side-encryption-customer-key"
	HEADER_SSEC_COPY_SOURCE_KEY_MD5    = "copy-source-server-side-encryption-customer-key-MD5"

	HEADER_SSEKMS_KEY_AMZ = "x-amz-server-side-encryption-aws-kms-key-id"

	HEADER_SSEKMS_KEY_OBS = "x-obs-server-side-encryption-kms-key-id"

	HEADER_SUCCESS_ACTION_REDIRECT = "success_action_redirect"

	HEADER_FS_FILE_INTERFACE = "fs-file-interface"

	HEADER_DATE_CAMEL                          = "Date"
	HEADER_HOST_CAMEL                          = "Host"
	HEADER_HOST                                = "host"
	HEADER_AUTH_CAMEL                          = "Authorization"
	HEADER_MD5_CAMEL                           = "Content-MD5"
	HEADER_LOCATION_CAMEL                      = "Location"
	HEADER_CONTENT_LENGTH_CAMEL                = "Content-Length"
	HEADER_CONTENT_TYPE_CAML                   = "Content-Type"
	HEADER_USER_AGENT_CAMEL                    = "User-Agent"
	HEADER_ORIGIN_CAMEL                        = "Origin"
	HEADER_ACCESS_CONTROL_REQUEST_HEADER_CAMEL = "Access-Control-Request-Headers"
	HEADER_CACHE_CONTROL_CAMEL                 = "Cache-Control"
	HEADER_CONTENT_DISPOSITION_CAMEL           = "Content-Disposition"
	HEADER_CONTENT_ENCODING_CAMEL              = "Content-Encoding"
	HEADER_CONTENT_LANGUAGE_CAMEL              = "Content-Language"
	HEADER_EXPIRES_CAMEL                       = "Expires"

	PARAM_VERSION_ID                   = "versionId"
	PARAM_RESPONSE_CONTENT_TYPE        = "response-content-type"
	PARAM_RESPONSE_CONTENT_LANGUAGE    = "response-content-language"
	PARAM_RESPONSE_EXPIRES             = "response-expires"
	PARAM_RESPONSE_CACHE_CONTROL       = "response-cache-control"
	PARAM_RESPONSE_CONTENT_DISPOSITION = "response-content-disposition"
	PARAM_RESPONSE_CONTENT_ENCODING    = "response-content-encoding"
	PARAM_IMAGE_PROCESS                = "x-image-process"

	PARAM_ALGORITHM_AMZ_CAMEL     = "X-Amz-Algorithm"
	PARAM_CREDENTIAL_AMZ_CAMEL    = "X-Amz-Credential"
	PARAM_DATE_AMZ_CAMEL          = "X-Amz-Date"
	PARAM_DATE_OBS_CAMEL          = "X-Obs-Date"
	PARAM_EXPIRES_AMZ_CAMEL       = "X-Amz-Expires"
	PARAM_SIGNEDHEADERS_AMZ_CAMEL = "X-Amz-SignedHeaders"
	PARAM_SIGNATURE_AMZ_CAMEL     = "X-Amz-Signature"

	DEFAULT_SIGNATURE            = SignatureV2
	DEFAULT_REGION               = "region"
	DEFAULT_CONNECT_TIMEOUT      = 60
	DEFAULT_SOCKET_TIMEOUT       = 60
	DEFAULT_HEADER_TIMEOUT       = 60
	DEFAULT_IDLE_CONN_TIMEOUT    = 30
	DEFAULT_MAX_RETRY_COUNT      = 3
	DEFAULT_MAX_REDIRECT_COUNT   = 3
	DEFAULT_MAX_CONN_PER_HOST    = 1000
	EMPTY_CONTENT_SHA256         = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
	UNSIGNED_PAYLOAD             = "UNSIGNED-PAYLOAD"
	LONG_DATE_FORMAT             = "20060102T150405Z"
	SHORT_DATE_FORMAT            = "20060102"
	ISO8601_DATE_FORMAT          = "2006-01-02T15:04:05Z"
	ISO8601_MIDNIGHT_DATE_FORMAT = "2006-01-02T00:00:00Z"
	RFC1123_FORMAT               = "Mon, 02 Jan 2006 15:04:05 GMT"

	V4_SERVICE_NAME   = "s3"
	V4_SERVICE_SUFFIX = "aws4_request"

	V2_HASH_PREFIX  = "AWS"
	OBS_HASH_PREFIX = "OBS"

	V4_HASH_PREFIX = "AWS4-HMAC-SHA256"
	V4_HASH_PRE    = "AWS4"

	DEFAULT_SSE_KMS_ENCRYPTION     = "aws:kms"
	DEFAULT_SSE_KMS_ENCRYPTION_OBS = "kms"

	DEFAULT_SSE_C_ENCRYPTION = "AES256"

	HTTP_GET     = "GET"
	HTTP_POST    = "POST"
	HTTP_PUT     = "PUT"
	HTTP_DELETE  = "DELETE"
	HTTP_HEAD    = "HEAD"
	HTTP_OPTIONS = "OPTIONS"

	MAX_PART_SIZE     = 5 * 1024 * 1024 * 1024
	MIN_PART_SIZE     = 100 * 1024
	DEFAULT_PART_SIZE = 9 * 1024 * 1024
	MAX_PART_NUM      = 10000
)

Variables

View Source
var ErrPoolShutDown = errors.New("RoutinePool is shutdown")

ErrPoolShutDown will be returned if RoutinePool is shutdown

View Source
var ErrSubmitTimeout = errors.New("Submit task timeout")

ErrSubmitTimeout will be returned if submit task timeout when calling SubmitWithTimeout function

View Source
var ErrTaskInvalid = errors.New("Task is nil")

ErrTaskInvalid will be returned if the task is nil

View Source
var ErrTaskReject = errors.New("Submit task is rejected")

ErrTaskReject will be returned if submit task is rejected

Functions

func Base64Decode

func Base64Decode(value string) ([]byte, error)

Base64Decode wrapper of base64.StdEncoding.DecodeString

func Base64Encode

func Base64Encode(value []byte) string

Base64Encode wrapper of base64.StdEncoding.EncodeToString

func Base64Md5

func Base64Md5(value []byte) string

Base64Md5 returns the md5 value of input with Base64Encode

func CloseLog

func CloseLog()

func ConverntObsRestoreToXml

func ConverntObsRestoreToXml(restoreObjectInput RestoreObjectInput) string

ConverntObsRestoreToXml converts RestoreObjectInput value to XML data and returns it

func ConvertAclToXml

func ConvertAclToXml(input AccessControlPolicy, returnMd5 bool, isObs bool) (data string, md5 string)

ConvertAclToXml converts AccessControlPolicy value to XML data and returns it

func ConvertCompleteMultipartUploadInputToXml

func ConvertCompleteMultipartUploadInputToXml(input CompleteMultipartUploadInput, returnMd5 bool) (data string, md5 string)

ConvertCompleteMultipartUploadInputToXml converts CompleteMultipartUploadInput value to XML data and returns it

func ConvertEncryptionConfigurationToXml added in v0.5.0

func ConvertEncryptionConfigurationToXml(input BucketEncryptionConfiguration, returnMd5 bool, isObs bool) (data string, md5 string)

ConvertEncryptionConfigurationToXml converts BucketEncryptionConfiguration value to XML data and returns it

func ConvertLifecyleConfigurationToXml

func ConvertLifecyleConfigurationToXml(input BucketLifecycleConfiguration, returnMd5 bool, isObs bool) (data string, md5 string)

ConvertLifecyleConfigurationToXml converts BucketLifecyleConfiguration value to XML data and returns it

func ConvertLoggingStatusToXml

func ConvertLoggingStatusToXml(input BucketLoggingStatus, returnMd5 bool, isObs bool) (data string, md5 string)

func ConvertNotificationToXml

func ConvertNotificationToXml(input BucketNotification, returnMd5 bool, isObs bool) (data string, md5 string)

ConvertNotificationToXml converts BucketNotification value to XML data and returns it

func ConvertRequestToIoReader

func ConvertRequestToIoReader(req interface{}) (io.Reader, error)

ConvertRequestToIoReader converts req to XML data

func ConvertRequestToIoReaderV2

func ConvertRequestToIoReaderV2(req interface{}) (io.Reader, string, error)

ConvertRequestToIoReaderV2 converts req to XML data

func ConvertWebsiteConfigurationToXml

func ConvertWebsiteConfigurationToXml(input BucketWebsiteConfiguration, returnMd5 bool) (data string, md5 string)

ConvertWebsiteConfigurationToXml converts BucketWebsiteConfiguration value to XML data and returns it

func DoLog

func DoLog(level Level, format string, v ...interface{})

func DummyQueryEscape

func DummyQueryEscape(s string) string

func FormatUtcNow

func FormatUtcNow(format string) string

FormatUtcNow gets a textual representation of the UTC format time value

func FormatUtcToRfc1123

func FormatUtcToRfc1123(t time.Time) string

FormatUtcToRfc1123 gets a textual representation of the RFC1123 format time value

func GetAuthorization

func GetAuthorization(ak, sk, method, bucketName, objectKey, queryUrl string, headers map[string][]string) (ret map[string]string)

GetAuthorization Authorization

func GetCurrentTimestamp

func GetCurrentTimestamp() int64

GetCurrentTimestamp gets unix time in milliseconds

func GetV2Authorization

func GetV2Authorization(ak, sk, method, bucketName, objectKey, queryUrl string, headers map[string][]string) (ret map[string]string)

GetV2Authorization v2 Authorization

func Hex

func Hex(value []byte) string

Hex wrapper of hex.EncodeToString

func HexMd5

func HexMd5(value []byte) string

HexMd5 returns the md5 value of input in hexadecimal format

func HexSha256

func HexSha256(value []byte) string

HexSha256 returns the Sha256Hash value of input in hexadecimal format

func HmacSha1

func HmacSha1(key, value []byte) []byte

HmacSha1 gets hmac sha1 value of input

func HmacSha256

func HmacSha256(key, value []byte) []byte

HmacSha256 get hmac sha256 value if input

func InitLog

func InitLog(logFullPath string, maxLogSize int64, backups int, level Level, logToConsole bool) error

func InitLogWithCacheCnt

func InitLogWithCacheCnt(logFullPath string, maxLogSize int64, backups int, level Level, logToConsole bool, cacheCnt int) error

func Int64ToString

func Int64ToString(value int64) string

Int64ToString converts int64 value to string value

func IntToString

func IntToString(value int) string

IntToString converts int value to string value

func IsIP

func IsIP(value string) bool

IsIP checks whether the value matches ip address

func Md5

func Md5(value []byte) []byte

Md5 gets the md5 value of input

func ParseCompleteMultipartUploadOutput

func ParseCompleteMultipartUploadOutput(output *CompleteMultipartUploadOutput)

ParseCompleteMultipartUploadOutput sets CompleteMultipartUploadOutput field values with response headers

func ParseCopyObjectOutput

func ParseCopyObjectOutput(output *CopyObjectOutput)

ParseCopyObjectOutput sets CopyObjectOutput field values with response headers

func ParseCopyPartOutput

func ParseCopyPartOutput(output *CopyPartOutput)

ParseCopyPartOutput sets CopyPartOutput field values with response headers

func ParseDeleteObjectOutput

func ParseDeleteObjectOutput(output *DeleteObjectOutput)

ParseDeleteObjectOutput sets DeleteObjectOutput field values with response headers

func ParseGetBucketMetadataOutput

func ParseGetBucketMetadataOutput(output *GetBucketMetadataOutput)

ParseGetBucketMetadataOutput sets GetBucketMetadataOutput field values with response headers

func ParseGetObjectMetadataOutput

func ParseGetObjectMetadataOutput(output *GetObjectMetadataOutput)

ParseGetObjectMetadataOutput sets GetObjectMetadataOutput field values with response headers

func ParseGetObjectOutput

func ParseGetObjectOutput(output *GetObjectOutput)

ParseGetObjectOutput sets GetObjectOutput field values with response headers

func ParseInitiateMultipartUploadOutput

func ParseInitiateMultipartUploadOutput(output *InitiateMultipartUploadOutput)

ParseInitiateMultipartUploadOutput sets InitiateMultipartUploadOutput field values with response headers

func ParsePutObjectOutput

func ParsePutObjectOutput(output *PutObjectOutput)

ParsePutObjectOutput sets PutObjectOutput field values with response headers

func ParseResponseToBaseModel

func ParseResponseToBaseModel(resp *http.Response, baseModel IBaseModel, xmlResult bool, _ bool) (err error)

ParseResponseToBaseModel gets response from OBS

func ParseResponseToObsError

func ParseResponseToObsError(resp *http.Response, isObs bool) error

ParseResponseToObsError gets obsError from OBS

func ParseSetObjectMetadataOutput

func ParseSetObjectMetadataOutput(output *SetObjectMetadataOutput)

ParseSetObjectMetadataOutput sets SetObjectMetadataOutput field values with response headers

func ParseUploadPartOutput

func ParseUploadPartOutput(output *UploadPartOutput)

ParseUploadPartOutput sets UploadPartOutput field values with response headers

func ParseXml

func ParseXml(value []byte, result interface{}) error

ParseXml wrapper of xml.Unmarshal

func Sha256Hash

func Sha256Hash(value []byte) []byte

Sha256Hash returns sha256 checksum

func StringContains

func StringContains(src string, subStr string, subTranscoding string) string

StringContains replaces subStr in src with subTranscoding and returns the new string

func StringToInt

func StringToInt(value string, def int) int

StringToInt converts string value to int value with default value

func StringToInt64

func StringToInt64(value string, def int64) int64

StringToInt64 converts string value to int64 value with default value

func SyncLog

func SyncLog()

func TransToXml

func TransToXml(value interface{}) ([]byte, error)

TransToXml wrapper of xml.Marshal

func UrlDecode

func UrlDecode(value string) (string, error)

UrlDecode wrapper of url.QueryUnescape

func UrlDecodeWithoutError

func UrlDecodeWithoutError(value string) string

UrlDecodeWithoutError wrapper of UrlDecode

func UrlEncode

func UrlEncode(value string, chineseOnly bool) string

UrlEncode encodes the input value

func V4Auth

func V4Auth(ak, sk, region, method, canonicalizedURL, queryURL string, headers map[string][]string) map[string]string

V4Auth is a wrapper for v4Auth

func XmlTranscoding

func XmlTranscoding(src string) string

XmlTranscoding replaces special characters with their escaped form

Types

type AbortMultipartUploadInput

type AbortMultipartUploadInput struct {
	Bucket   string
	Key      string
	UploadId string
}

AbortMultipartUploadInput is the input parameter of AbortMultipartUpload function

type AccessControlPolicy

type AccessControlPolicy struct {
	XMLName   xml.Name `xml:"AccessControlPolicy"`
	Owner     Owner    `xml:"Owner"`
	Grants    []Grant  `xml:"AccessControlList>Grant"`
	Delivered string   `xml:"Delivered,omitempty"`
}

AccessControlPolicy defines access control policy properties

type AclType

type AclType string
const (
	AclPrivate                 AclType = "private"
	AclPublicRead              AclType = "public-read"
	AclPublicReadWrite         AclType = "public-read-write"
	AclAuthenticatedRead       AclType = "authenticated-read"
	AclBucketOwnerRead         AclType = "bucket-owner-read"
	AclBucketOwnerFullControl  AclType = "bucket-owner-full-control"
	AclLogDeliveryWrite        AclType = "log-delivery-write"
	AclPublicReadDelivery      AclType = "public-read-delivered"
	AclPublicReadWriteDelivery AclType = "public-read-write-delivered"
)

type BaseModel

type BaseModel struct {
	StatusCode      int                 `xml:"-"`
	RequestId       string              `xml:"RequestId" json:"request_id"`
	ResponseHeaders map[string][]string `xml:"-"`
}

BaseModel defines base model response from OBS

type Bucket

type Bucket struct {
	XMLName      xml.Name  `xml:"Bucket"`
	Name         string    `xml:"Name"`
	CreationDate time.Time `xml:"CreationDate"`
	Location     string    `xml:"Location"`
	BucketType   string    `xml:"BucketType,omitempty"`
}

Bucket defines bucket properties

type BucketCors

type BucketCors struct {
	XMLName   xml.Name   `xml:"CORSConfiguration"`
	CorsRules []CorsRule `xml:"CORSRule"`
}

BucketCors defines the bucket CORS configuration

type BucketEncryptionConfiguration added in v0.5.0

type BucketEncryptionConfiguration struct {
	XMLName        xml.Name `xml:"ServerSideEncryptionConfiguration"`
	SSEAlgorithm   string   `xml:"Rule>ApplyServerSideEncryptionByDefault>SSEAlgorithm"`
	KMSMasterKeyID string   `xml:"Rule>ApplyServerSideEncryptionByDefault>KMSMasterKeyID,omitempty"`
	ProjectID      string   `xml:"Rule>ApplyServerSideEncryptionByDefault>ProjectID,omitempty"`
}

BucketEncryptionConfiguration defines the bucket encryption configuration

type BucketLifecycleConfiguration added in v0.5.24

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

BucketLifecycleConfiguration defines the bucket lifecycle configuration

type BucketLocation

type BucketLocation struct {
	XMLName  xml.Name `xml:"CreateBucketConfiguration"`
	Location string   `xml:"LocationConstraint,omitempty"`
}

BucketLocation defines bucket location configuration

type BucketLoggingStatus

type BucketLoggingStatus struct {
	XMLName      xml.Name `xml:"BucketLoggingStatus"`
	Agency       string   `xml:"Agency,omitempty"`
	TargetBucket string   `xml:"LoggingEnabled>TargetBucket,omitempty"`
	TargetPrefix string   `xml:"LoggingEnabled>TargetPrefix,omitempty"`
	TargetGrants []Grant  `xml:"LoggingEnabled>TargetGrants>Grant,omitempty"`
}

BucketLoggingStatus defines the bucket logging configuration

type BucketNotification

type BucketNotification struct {
	XMLName             xml.Name             `xml:"NotificationConfiguration"`
	TopicConfigurations []TopicConfiguration `xml:"TopicConfiguration"`
}

BucketNotification defines the bucket notification configuration

type BucketQuota

type BucketQuota struct {
	XMLName xml.Name `xml:"Quota"`
	Quota   int64    `xml:"StorageQuota"`
}

BucketQuota defines bucket quota configuration

type BucketStoragePolicy

type BucketStoragePolicy struct {
	XMLName      xml.Name         `xml:"StoragePolicy"`
	StorageClass StorageClassType `xml:"DefaultStorageClass"`
}

BucketStoragePolicy defines the bucket storage class

type BucketTagging

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

BucketTagging defines the bucket tag configuration

type BucketType added in v0.5.24

type BucketType string

BucketType defines type of bucket

const (
	OBJECT BucketType = "OBJECT"
	POSIX  BucketType = "POSIX"
)

type BucketVersioningConfiguration

type BucketVersioningConfiguration struct {
	XMLName xml.Name             `xml:"VersioningConfiguration"`
	Status  VersioningStatusType `xml:"Status"`
}

BucketVersioningConfiguration defines the versioning configuration

type BucketWebsiteConfiguration

type BucketWebsiteConfiguration struct {
	XMLName               xml.Name              `xml:"WebsiteConfiguration"`
	RedirectAllRequestsTo RedirectAllRequestsTo `xml:"RedirectAllRequestsTo,omitempty"`
	IndexDocument         IndexDocument         `xml:"IndexDocument,omitempty"`
	ErrorDocument         ErrorDocument         `xml:"ErrorDocument,omitempty"`
	RoutingRules          []RoutingRule         `xml:"RoutingRules>RoutingRule,omitempty"`
}

BucketWebsiteConfiguration defines the bucket website configuration

type CompleteMultipartUploadInput

type CompleteMultipartUploadInput struct {
	Bucket   string   `xml:"-"`
	Key      string   `xml:"-"`
	UploadId string   `xml:"-"`
	XMLName  xml.Name `xml:"CompleteMultipartUpload"`
	Parts    []Part   `xml:"Part"`
}

CompleteMultipartUploadInput is the input parameter of CompleteMultipartUpload function

type CompleteMultipartUploadOutput

type CompleteMultipartUploadOutput struct {
	BaseModel
	VersionId string     `xml:"-"`
	SseHeader ISseHeader `xml:"-"`
	XMLName   xml.Name   `xml:"CompleteMultipartUploadResult"`
	Location  string     `xml:"Location"`
	Bucket    string     `xml:"Bucket"`
	Key       string     `xml:"Key"`
	ETag      string     `xml:"ETag"`
}

CompleteMultipartUploadOutput is the result of CompleteMultipartUpload function

type Condition

type Condition struct {
	XMLName                     xml.Name `xml:"Condition"`
	KeyPrefixEquals             string   `xml:"KeyPrefixEquals,omitempty"`
	HttpErrorCodeReturnedEquals string   `xml:"HttpErrorCodeReturnedEquals,omitempty"`
}

Condition defines condition in RoutingRule

type Configurer added in v0.2.1

type Configurer func(conf *config)

func WithConnectTimeout

func WithConnectTimeout(connectTimeout int) Configurer

WithConnectTimeout is a configurer for ObsClient to set timeout period for establishing a http/https connection, in seconds.

func WithCustomDomainName

func WithCustomDomainName(cname bool) Configurer

WithCustomDomainName is a configurer for ObsClient.

func WithHeaderTimeout

func WithHeaderTimeout(headerTimeout int) Configurer

WithHeaderTimeout is a configurer for ObsClient to set the timeout period of obtaining the response headers.

func WithHttpTransport

func WithHttpTransport(transport *http.Transport) Configurer

WithHttpTransport is a configurer for ObsClient to set the customized http Transport.

func WithIdleConnTimeout

func WithIdleConnTimeout(idleConnTimeout int) Configurer

WithIdleConnTimeout is a configurer for ObsClient to set the timeout period of an idle HTTP connection in the connection pool, in seconds.

func WithMaxConnections

func WithMaxConnections(maxConnsPerHost int) Configurer

WithMaxConnections is a configurer for ObsClient to set the maximum number of idle HTTP connections.

func WithMaxRedirectCount

func WithMaxRedirectCount(maxRedirectCount int) Configurer

WithMaxRedirectCount is a configurer for ObsClient to set the maximum number of times that the request is redirected.

func WithMaxRetryCount

func WithMaxRetryCount(maxRetryCount int) Configurer

WithMaxRetryCount is a configurer for ObsClient to set the maximum number of retries when an HTTP/HTTPS connection is abnormal.

func WithPathStyle

func WithPathStyle(pathStyle bool) Configurer

WithPathStyle is a configurer for ObsClient.

func WithProxyUrl

func WithProxyUrl(proxyUrl string) Configurer

WithProxyUrl is a configurer for ObsClient to set HTTP proxy.

func WithRegion

func WithRegion(region string) Configurer

WithRegion is a configurer for ObsClient.

func WithRequestContext

func WithRequestContext(ctx context.Context) Configurer

WithRequestContext is a configurer for ObsClient to set the context for each HTTP request.

func WithSecurityToken

func WithSecurityToken(securityToken string) Configurer

WithSecurityToken is a configurer for ObsClient to set the security token in the temporary access keys.

func WithSignature

func WithSignature(signature SignatureType) Configurer

WithSignature is a configurer for ObsClient.

func WithSocketTimeout

func WithSocketTimeout(socketTimeout int) Configurer

WithSocketTimeout is a configurer for ObsClient to set the timeout duration for transmitting data at the socket layer, in seconds.

func WithSslVerify

func WithSslVerify(sslVerify bool) Configurer

WithSslVerify is a wrapper for WithSslVerifyAndPemCerts.

func WithSslVerifyAndPemCerts

func WithSslVerifyAndPemCerts(sslVerify bool, pemCerts []byte) Configurer

WithSslVerifyAndPemCerts is a configurer for ObsClient to set conf.sslVerify and conf.pemCerts.

type Content

type Content struct {
	XMLName      xml.Name         `xml:"Contents"`
	Owner        Owner            `xml:"Owner"`
	ETag         string           `xml:"ETag"`
	Key          string           `xml:"Key"`
	LastModified time.Time        `xml:"LastModified"`
	Size         int64            `xml:"Size"`
	StorageClass StorageClassType `xml:"StorageClass"`
}

Content defines the object content properties

type CopyObjectInput

type CopyObjectInput struct {
	ObjectOperationInput
	CopySourceBucket            string
	CopySourceKey               string
	CopySourceVersionId         string
	CopySourceIfMatch           string
	CopySourceIfNoneMatch       string
	CopySourceIfUnmodifiedSince time.Time
	CopySourceIfModifiedSince   time.Time
	SourceSseHeader             ISseHeader
	CacheControl                string
	ContentDisposition          string
	ContentEncoding             string
	ContentLanguage             string
	ContentType                 string
	Expires                     string
	MetadataDirective           MetadataDirectiveType
	SuccessActionRedirect       string
}

CopyObjectInput is the input parameter of CopyObject function

type CopyObjectOutput

type CopyObjectOutput struct {
	BaseModel
	CopySourceVersionId string     `xml:"-"`
	VersionId           string     `xml:"-"`
	SseHeader           ISseHeader `xml:"-"`
	XMLName             xml.Name   `xml:"CopyObjectResult"`
	LastModified        time.Time  `xml:"LastModified"`
	ETag                string     `xml:"ETag"`
}

CopyObjectOutput is the result of CopyObject function

type CopyPartInput

type CopyPartInput struct {
	Bucket               string
	Key                  string
	UploadId             string
	PartNumber           int
	CopySourceBucket     string
	CopySourceKey        string
	CopySourceVersionId  string
	CopySourceRangeStart int64
	CopySourceRangeEnd   int64
	SseHeader            ISseHeader
	SourceSseHeader      ISseHeader
}

CopyPartInput is the input parameter of CopyPart function

type CopyPartOutput

type CopyPartOutput struct {
	BaseModel
	XMLName      xml.Name   `xml:"CopyPartResult"`
	PartNumber   int        `xml:"-"`
	ETag         string     `xml:"ETag"`
	LastModified time.Time  `xml:"LastModified"`
	SseHeader    ISseHeader `xml:"-"`
}

CopyPartOutput is the result of CopyPart function

type CorsRule

type CorsRule struct {
	XMLName       xml.Name `xml:"CORSRule"`
	ID            string   `xml:"ID,omitempty"`
	AllowedOrigin []string `xml:"AllowedOrigin"`
	AllowedMethod []string `xml:"AllowedMethod"`
	AllowedHeader []string `xml:"AllowedHeader,omitempty"`
	MaxAgeSeconds int      `xml:"MaxAgeSeconds"`
	ExposeHeader  []string `xml:"ExposeHeader,omitempty"`
}

CorsRule defines the CORS rules

type CreateBrowserBasedSignatureInput

type CreateBrowserBasedSignatureInput struct {
	Bucket     string
	Key        string
	Expires    int
	FormParams map[string]string
}

CreateBrowserBasedSignatureInput is the input parameter of CreateBrowserBasedSignature function.

type CreateBrowserBasedSignatureOutput

type CreateBrowserBasedSignatureOutput struct {
	OriginPolicy string
	Policy       string
	Algorithm    string
	Credential   string
	Date         string
	Signature    string
}

CreateBrowserBasedSignatureOutput is the result of CreateBrowserBasedSignature function.

type CreateBucketInput

type CreateBucketInput struct {
	BucketLocation
	Bucket                      string           `xml:"-"`
	ACL                         AclType          `xml:"-"`
	StorageClass                StorageClassType `xml:"-"`
	GrantReadId                 string           `xml:"-"`
	GrantWriteId                string           `xml:"-"`
	GrantReadAcpId              string           `xml:"-"`
	GrantWriteAcpId             string           `xml:"-"`
	GrantFullControlId          string           `xml:"-"`
	GrantReadDeliveredId        string           `xml:"-"`
	GrantFullControlDeliveredId string           `xml:"-"`
	Epid                        string           `xml:"-"`
	IsFSFileInterface           bool             `xml:"-"`
}

CreateBucketInput is the input parameter of CreateBucket function

type CreateSignedUrlInput

type CreateSignedUrlInput struct {
	Method      HttpMethodType
	Bucket      string
	Key         string
	SubResource SubResourceType
	Expires     int
	Headers     map[string]string
	QueryParams map[string]string
}

CreateSignedUrlInput is the input parameter of CreateSignedUrl function

type CreateSignedUrlOutput

type CreateSignedUrlOutput struct {
	SignedUrl                  string
	ActualSignedRequestHeaders http.Header
}

CreateSignedUrlOutput is the result of CreateSignedUrl function

type DefaultSerializable

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

DefaultSerializable defines default serializable struct

type DeleteMarker

type DeleteMarker struct {
	XMLName      xml.Name         `xml:"DeleteMarker"`
	Key          string           `xml:"Key"`
	VersionId    string           `xml:"VersionId"`
	IsLatest     bool             `xml:"IsLatest"`
	LastModified time.Time        `xml:"LastModified"`
	Owner        Owner            `xml:"Owner"`
	StorageClass StorageClassType `xml:"StorageClass"`
}

DeleteMarker defines the properties of versioning delete markers

type DeleteObjectInput

type DeleteObjectInput struct {
	Bucket    string
	Key       string
	VersionId string
}

DeleteObjectInput is the input parameter of DeleteObject function

type DeleteObjectOutput

type DeleteObjectOutput struct {
	BaseModel
	VersionId    string
	DeleteMarker bool
}

DeleteObjectOutput is the result of DeleteObject function

type DeleteObjectsInput

type DeleteObjectsInput struct {
	Bucket  string           `xml:"-"`
	XMLName xml.Name         `xml:"Delete"`
	Quiet   bool             `xml:"Quiet,omitempty"`
	Objects []ObjectToDelete `xml:"Object"`
}

DeleteObjectsInput is the input parameter of DeleteObjects function

type DeleteObjectsOutput

type DeleteObjectsOutput struct {
	BaseModel
	XMLName  xml.Name  `xml:"DeleteResult"`
	Deleteds []Deleted `xml:"Deleted"`
	Errors   []Error   `xml:"Error"`
}

DeleteObjectsOutput is the result of DeleteObjects function

type Deleted

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

Deleted defines the deleted property in DeleteObjectsOutput

type DownloadCheckpoint added in v0.5.24

type DownloadCheckpoint struct {
	XMLName       xml.Name           `xml:"DownloadFileCheckpoint"`
	Bucket        string             `xml:"Bucket"`
	Key           string             `xml:"Key"`
	VersionId     string             `xml:"VersionId,omitempty"`
	DownloadFile  string             `xml:"FileUrl"`
	ObjectInfo    ObjectInfo         `xml:"ObjectInfo"`
	TempFileInfo  TempFileInfo       `xml:"TempFileInfo"`
	DownloadParts []DownloadPartInfo `xml:"DownloadParts>DownloadPart"`
}

DownloadCheckpoint defines download checkpoint file properties

type DownloadFileInput added in v0.5.24

type DownloadFileInput struct {
	GetObjectMetadataInput
	IfMatch           string
	IfNoneMatch       string
	IfModifiedSince   time.Time
	IfUnmodifiedSince time.Time
	DownloadFile      string
	PartSize          int64
	TaskNum           int
	EnableCheckpoint  bool
	CheckpointFile    string
}

DownloadFileInput is the input parameter of DownloadFile function

type DownloadPartInfo added in v0.5.24

type DownloadPartInfo struct {
	XMLName     xml.Name `xml:"DownloadPart"`
	PartNumber  int64    `xml:"PartNumber"`
	RangeEnd    int64    `xml:"RangeEnd"`
	Offset      int64    `xml:"Offset"`
	IsCompleted bool     `xml:"IsCompleted"`
}

DownloadPartInfo defines download part properties

type Error

type Error struct {
	XMLName   xml.Name `xml:"Error"`
	Key       string   `xml:"Key"`
	VersionId string   `xml:"VersionId"`
	Code      string   `xml:"Code"`
	Message   string   `xml:"Message"`
}

Error defines the error property in DeleteObjectsOutput

type ErrorDocument

type ErrorDocument struct {
	Key string `xml:"Key,omitempty"`
}

ErrorDocument defines the error page configuration

type EventType

type EventType string
const (
	ObjectCreatedAll  EventType = "ObjectCreated:*"
	ObjectCreatedPut  EventType = "ObjectCreated:Put"
	ObjectCreatedPost EventType = "ObjectCreated:Post"

	ObjectCreatedCopy                    EventType = "ObjectCreated:Copy"
	ObjectCreatedCompleteMultipartUpload EventType = "ObjectCreated:CompleteMultipartUpload"
	ObjectRemovedAll                     EventType = "ObjectRemoved:*"
	ObjectRemovedDelete                  EventType = "ObjectRemoved:Delete"
	ObjectRemovedDeleteMarkerCreated     EventType = "ObjectRemoved:DeleteMarkerCreated"
)

func ParseStringToEventType

func ParseStringToEventType(value string) (ret EventType)

ParseStringToEventType converts string value to EventType value and returns it

type Expiration

type Expiration struct {
	XMLName xml.Name  `xml:"Expiration"`
	Date    time.Time `xml:"Date,omitempty"`
	Days    int       `xml:"Days,omitempty"`
}

Expiration defines expiration property in LifecycleRule

type FileStatus added in v0.5.24

type FileStatus struct {
	XMLName      xml.Name `xml:"FileInfo"`
	LastModified int64    `xml:"LastModified"`
	Size         int64    `xml:"Size"`
}

FileStatus defines the upload file properties

type FilterRule

type FilterRule struct {
	XMLName xml.Name `xml:"FilterRule"`
	Name    string   `xml:"Name,omitempty"`
	Value   string   `xml:"Value,omitempty"`
}

FilterRule defines filter rule in TopicConfiguration

type Future added in v0.5.24

type Future interface {
	Get() interface{}
}

Future defines interface with function: Get

type FutureResult added in v0.5.24

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

FutureResult for task result

func (*FutureResult) Get added in v0.5.24

func (f *FutureResult) Get() interface{}

Get gets the task result

type GetBucketAclOutput

type GetBucketAclOutput struct {
	BaseModel
	AccessControlPolicy
}

GetBucketAclOutput is the result of GetBucketAcl function

type GetBucketCorsOutput

type GetBucketCorsOutput struct {
	BaseModel
	BucketCors
}

GetBucketCorsOutput is the result of GetBucketCors function

type GetBucketEncryptionOutput added in v0.5.0

type GetBucketEncryptionOutput struct {
	BaseModel
	BucketEncryptionConfiguration
}

GetBucketEncryptionOutput is the result of GetBucketEncryption function

type GetBucketLifecycleConfigurationOutput

type GetBucketLifecycleConfigurationOutput struct {
	BaseModel
	BucketLifecycleConfiguration
}

GetBucketLifecycleConfigurationOutput is the result of GetBucketLifecycleConfiguration function

type GetBucketLocationOutput

type GetBucketLocationOutput struct {
	BaseModel
	Location string `xml:"-"`
}

GetBucketLocationOutput is the result of GetBucketLocation function

type GetBucketLoggingConfigurationOutput

type GetBucketLoggingConfigurationOutput struct {
	BaseModel
	BucketLoggingStatus
}

GetBucketLoggingConfigurationOutput is the result of GetBucketLoggingConfiguration function

type GetBucketMetadataInput

type GetBucketMetadataInput struct {
	Bucket        string
	Origin        string
	RequestHeader string
}

GetBucketMetadataInput is the input parameter of GetBucketMetadata function

type GetBucketMetadataOutput

type GetBucketMetadataOutput struct {
	BaseModel
	StorageClass  StorageClassType
	Location      string
	Version       string
	AllowOrigin   string
	AllowMethod   string
	AllowHeader   string
	MaxAgeSeconds int
	ExposeHeader  string
	Epid          string
}

GetBucketMetadataOutput is the result of GetBucketMetadata function

type GetBucketNotificationOutput

type GetBucketNotificationOutput struct {
	BaseModel
	BucketNotification
}

GetBucketNotificationOutput is the result of GetBucketNotification function

type GetBucketPolicyOutput

type GetBucketPolicyOutput struct {
	BaseModel
	Policy string `json:"body"`
}

GetBucketPolicyOutput is the result of GetBucketPolicy function

type GetBucketQuotaOutput

type GetBucketQuotaOutput struct {
	BaseModel
	BucketQuota
}

GetBucketQuotaOutput is the result of GetBucketQuota function

type GetBucketStorageInfoOutput

type GetBucketStorageInfoOutput struct {
	BaseModel
	XMLName      xml.Name `xml:"GetBucketStorageInfoResult"`
	Size         int64    `xml:"Size"`
	ObjectNumber int      `xml:"ObjectNumber"`
}

GetBucketStorageInfoOutput is the result of GetBucketStorageInfo function

type GetBucketStoragePolicyOutput

type GetBucketStoragePolicyOutput struct {
	BaseModel
	StorageClass string
}

GetBucketStoragePolicyOutput is the result of GetBucketStoragePolicy function

type GetBucketTaggingOutput

type GetBucketTaggingOutput struct {
	BaseModel
	BucketTagging
}

GetBucketTaggingOutput is the result of GetBucketTagging function

type GetBucketVersioningOutput

type GetBucketVersioningOutput struct {
	BaseModel
	BucketVersioningConfiguration
}

GetBucketVersioningOutput is the result of GetBucketVersioning function

type GetBucketWebsiteConfigurationOutput

type GetBucketWebsiteConfigurationOutput struct {
	BaseModel
	BucketWebsiteConfiguration
}

GetBucketWebsiteConfigurationOutput is the result of GetBucketWebsiteConfiguration function

type GetObjectAclInput

type GetObjectAclInput struct {
	Bucket    string
	Key       string
	VersionId string
}

GetObjectAclInput is the input parameter of GetObjectAcl function

type GetObjectAclOutput

type GetObjectAclOutput struct {
	BaseModel
	VersionId string
	AccessControlPolicy
}

GetObjectAclOutput is the result of GetObjectAcl function

type GetObjectInput

type GetObjectInput struct {
	GetObjectMetadataInput
	IfMatch                    string
	IfNoneMatch                string
	IfUnmodifiedSince          time.Time
	IfModifiedSince            time.Time
	RangeStart                 int64
	RangeEnd                   int64
	ImageProcess               string
	ResponseCacheControl       string
	ResponseContentDisposition string
	ResponseContentEncoding    string
	ResponseContentLanguage    string
	ResponseContentType        string
	ResponseExpires            string
}

GetObjectInput is the input parameter of GetObject function

type GetObjectMetadataInput

type GetObjectMetadataInput struct {
	Bucket        string
	Key           string
	VersionId     string
	Origin        string
	RequestHeader string
	SseHeader     ISseHeader
}

GetObjectMetadataInput is the input parameter of GetObjectMetadata function

type GetObjectMetadataOutput

type GetObjectMetadataOutput struct {
	BaseModel
	VersionId               string
	WebsiteRedirectLocation string
	Expiration              string
	Restore                 string
	ObjectType              string
	NextAppendPosition      string
	StorageClass            StorageClassType
	ContentLength           int64
	ContentType             string
	ETag                    string
	AllowOrigin             string
	AllowHeader             string
	AllowMethod             string
	ExposeHeader            string
	MaxAgeSeconds           int
	LastModified            time.Time
	SseHeader               ISseHeader
	Metadata                map[string]string
}

GetObjectMetadataOutput is the result of GetObjectMetadata function

type GetObjectOutput

type GetObjectOutput struct {
	GetObjectMetadataOutput
	DeleteMarker       bool
	CacheControl       string
	ContentDisposition string
	ContentEncoding    string
	ContentLanguage    string
	Expires            string
	Body               io.ReadCloser
}

GetObjectOutput is the result of GetObject function

type Grant

type Grant struct {
	XMLName    xml.Name       `xml:"Grant"`
	Grantee    Grantee        `xml:"Grantee"`
	Permission PermissionType `xml:"Permission"`
	Delivered  bool           `xml:"Delivered"`
}

Grant defines grant properties

type Grantee

type Grantee struct {
	XMLName     xml.Name     `xml:"Grantee"`
	Type        GranteeType  `xml:"type,attr"`
	ID          string       `xml:"ID,omitempty"`
	DisplayName string       `xml:"DisplayName,omitempty"`
	URI         GroupUriType `xml:"URI,omitempty"`
}

Grantee defines grantee properties

type GranteeType

type GranteeType string
const (
	GranteeGroup GranteeType = "Group"
	GranteeUser  GranteeType = "CanonicalUser"
)

type GroupUriType

type GroupUriType string
const (
	GroupAllUsers           GroupUriType = "AllUsers"
	GroupAuthenticatedUsers GroupUriType = "AuthenticatedUsers"
	GroupLogDelivery        GroupUriType = "LogDelivery"
)

type HeadObjectInput added in v0.5.24

type HeadObjectInput struct {
	Bucket    string
	Key       string
	VersionId string
}

HeadObjectInput is the input parameter of HeadObject function

type HttpMethodType

type HttpMethodType string
const (
	HttpMethodGet     HttpMethodType = HTTP_GET
	HttpMethodPut     HttpMethodType = HTTP_PUT
	HttpMethodPost    HttpMethodType = HTTP_POST
	HttpMethodDelete  HttpMethodType = HTTP_DELETE
	HttpMethodHead    HttpMethodType = HTTP_HEAD
	HttpMethodOptions HttpMethodType = HTTP_OPTIONS
)

type IBaseModel

type IBaseModel interface {
	// contains filtered or unexported methods
}

IBaseModel defines interface for base response model

type IReadCloser

type IReadCloser interface {
	// contains filtered or unexported methods
}

IReadCloser defines interface with function: setReadCloser

type ISerializable

type ISerializable interface {
	// contains filtered or unexported methods
}

ISerializable defines interface with function: trans

type ISseHeader

type ISseHeader interface {
	GetEncryption() string
	GetKey() string
}

ISseHeader defines the sse encryption header

type IndexDocument

type IndexDocument struct {
	Suffix string `xml:"Suffix"`
}

IndexDocument defines the default page configuration

type InitiateMultipartUploadInput

type InitiateMultipartUploadInput struct {
	ObjectOperationInput
	ContentType string
}

InitiateMultipartUploadInput is the input parameter of InitiateMultipartUpload function

type InitiateMultipartUploadOutput

type InitiateMultipartUploadOutput struct {
	BaseModel
	XMLName   xml.Name `xml:"InitiateMultipartUploadResult"`
	Bucket    string   `xml:"Bucket"`
	Key       string   `xml:"Key"`
	UploadId  string   `xml:"UploadId"`
	SseHeader ISseHeader
}

InitiateMultipartUploadOutput is the result of InitiateMultipartUpload function

type Initiator

type Initiator struct {
	XMLName     xml.Name `xml:"Initiator"`
	ID          string   `xml:"ID"`
	DisplayName string   `xml:"DisplayName,omitempty"`
}

Initiator defines initiator properties

type Level

type Level int
const (
	LEVEL_OFF   Level = 500
	LEVEL_ERROR Level = 400
	LEVEL_WARN  Level = 300
	LEVEL_INFO  Level = 200
	LEVEL_DEBUG Level = 100
)

type LifecycleRule

type LifecycleRule struct {
	ID                           string                        `xml:"ID,omitempty"`
	Prefix                       string                        `xml:"Prefix"`
	Status                       RuleStatusType                `xml:"Status"`
	Transitions                  []Transition                  `xml:"Transition,omitempty"`
	Expiration                   Expiration                    `xml:"Expiration,omitempty"`
	NoncurrentVersionTransitions []NoncurrentVersionTransition `xml:"NoncurrentVersionTransition,omitempty"`
	NoncurrentVersionExpiration  NoncurrentVersionExpiration   `xml:"NoncurrentVersionExpiration,omitempty"`
}

LifecycleRule defines lifecycle rule

type ListBucketsInput

type ListBucketsInput struct {
	QueryLocation bool
	BucketType    BucketType
}

ListBucketsInput is the input parameter of ListBuckets function

type ListBucketsOutput

type ListBucketsOutput struct {
	BaseModel
	XMLName xml.Name `xml:"ListAllMyBucketsResult"`
	Owner   Owner    `xml:"Owner"`
	Buckets []Bucket `xml:"Buckets>Bucket"`
}

ListBucketsOutput is the result of ListBuckets function

type ListMultipartUploadsInput

type ListMultipartUploadsInput struct {
	Bucket         string
	Prefix         string
	MaxUploads     int
	Delimiter      string
	KeyMarker      string
	UploadIdMarker string
}

ListMultipartUploadsInput is the input parameter of ListMultipartUploads function

type ListMultipartUploadsOutput

type ListMultipartUploadsOutput struct {
	BaseModel
	XMLName            xml.Name `xml:"ListMultipartUploadsResult"`
	Bucket             string   `xml:"Bucket"`
	KeyMarker          string   `xml:"KeyMarker"`
	NextKeyMarker      string   `xml:"NextKeyMarker"`
	UploadIdMarker     string   `xml:"UploadIdMarker"`
	NextUploadIdMarker string   `xml:"NextUploadIdMarker"`
	Delimiter          string   `xml:"Delimiter"`
	IsTruncated        bool     `xml:"IsTruncated"`
	MaxUploads         int      `xml:"MaxUploads"`
	Prefix             string   `xml:"Prefix"`
	Uploads            []Upload `xml:"Upload"`
	CommonPrefixes     []string `xml:"CommonPrefixes>Prefix"`
}

ListMultipartUploadsOutput is the result of ListMultipartUploads function

type ListObjectsInput

type ListObjectsInput struct {
	ListObjsInput
	Bucket string
	Marker string
}

ListObjectsInput is the input parameter of ListObjects function

type ListObjectsOutput

type ListObjectsOutput struct {
	BaseModel
	XMLName        xml.Name  `xml:"ListBucketResult"`
	Delimiter      string    `xml:"Delimiter"`
	IsTruncated    bool      `xml:"IsTruncated"`
	Marker         string    `xml:"Marker"`
	NextMarker     string    `xml:"NextMarker"`
	MaxKeys        int       `xml:"MaxKeys"`
	Name           string    `xml:"Name"`
	Prefix         string    `xml:"Prefix"`
	Contents       []Content `xml:"Contents"`
	CommonPrefixes []string  `xml:"CommonPrefixes>Prefix"`
	Location       string    `xml:"-"`
}

ListObjectsOutput is the result of ListObjects function

type ListObjsInput

type ListObjsInput struct {
	Prefix        string
	MaxKeys       int
	Delimiter     string
	Origin        string
	RequestHeader string
}

ListObjsInput defines parameters for listing objects

type ListPartsInput

type ListPartsInput struct {
	Bucket           string
	Key              string
	UploadId         string
	MaxParts         int
	PartNumberMarker int
}

ListPartsInput is the input parameter of ListParts function

type ListPartsOutput

type ListPartsOutput struct {
	BaseModel
	XMLName              xml.Name         `xml:"ListPartsResult"`
	Bucket               string           `xml:"Bucket"`
	Key                  string           `xml:"Key"`
	UploadId             string           `xml:"UploadId"`
	PartNumberMarker     int              `xml:"PartNumberMarker"`
	NextPartNumberMarker int              `xml:"NextPartNumberMarker"`
	MaxParts             int              `xml:"MaxParts"`
	IsTruncated          bool             `xml:"IsTruncated"`
	StorageClass         StorageClassType `xml:"StorageClass"`
	Initiator            Initiator        `xml:"Initiator"`
	Owner                Owner            `xml:"Owner"`
	Parts                []Part           `xml:"Part"`
}

ListPartsOutput is the result of ListParts function

type ListVersionsInput

type ListVersionsInput struct {
	ListObjsInput
	Bucket          string
	KeyMarker       string
	VersionIdMarker string
}

ListVersionsInput is the input parameter of ListVersions function

type ListVersionsOutput

type ListVersionsOutput struct {
	BaseModel
	XMLName             xml.Name       `xml:"ListVersionsResult"`
	Delimiter           string         `xml:"Delimiter"`
	IsTruncated         bool           `xml:"IsTruncated"`
	KeyMarker           string         `xml:"KeyMarker"`
	NextKeyMarker       string         `xml:"NextKeyMarker"`
	VersionIdMarker     string         `xml:"VersionIdMarker"`
	NextVersionIdMarker string         `xml:"NextVersionIdMarker"`
	MaxKeys             int            `xml:"MaxKeys"`
	Name                string         `xml:"Name"`
	Prefix              string         `xml:"Prefix"`
	Versions            []Version      `xml:"Version"`
	DeleteMarkers       []DeleteMarker `xml:"DeleteMarker"`
	CommonPrefixes      []string       `xml:"CommonPrefixes>Prefix"`
	Location            string         `xml:"-"`
}

ListVersionsOutput is the result of ListVersions function

type MetadataDirectiveType

type MetadataDirectiveType string
const (
	CopyMetadata    MetadataDirectiveType = "COPY"
	ReplaceNew      MetadataDirectiveType = "REPLACE_NEW"
	ReplaceMetadata MetadataDirectiveType = "REPLACE"
)

type NoChanPool added in v0.5.24

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

NoChanPool defines the coroutine pool struct

func (*NoChanPool) AddCurrentWorkingCnt added in v0.5.24

func (pool *NoChanPool) AddCurrentWorkingCnt(value int64) int64

func (*NoChanPool) AddMaxWorkerCnt added in v0.5.24

func (pool *NoChanPool) AddMaxWorkerCnt(value int64) int64

func (*NoChanPool) AddWorkerCnt added in v0.5.24

func (pool *NoChanPool) AddWorkerCnt(value int64) int64

func (*NoChanPool) CompareAndSwapCurrentWorkingCnt added in v0.5.24

func (pool *NoChanPool) CompareAndSwapCurrentWorkingCnt(oldValue, newValue int64) bool

func (*NoChanPool) EnableAutoTune added in v0.5.24

func (pool *NoChanPool) EnableAutoTune()

func (*NoChanPool) Execute added in v0.5.24

func (pool *NoChanPool) Execute(t Task)

Execute executes the specified task

func (*NoChanPool) ExecuteFunc added in v0.5.24

func (pool *NoChanPool) ExecuteFunc(f func() interface{})

ExecuteFunc creates a funcWrapper instance with the specified function and calls the Execute function

func (*NoChanPool) GetCurrentWorkingCnt added in v0.5.24

func (pool *NoChanPool) GetCurrentWorkingCnt() int64

func (*NoChanPool) GetMaxWorkerCnt added in v0.5.24

func (pool *NoChanPool) GetMaxWorkerCnt() int64

func (*NoChanPool) GetWorkerCnt added in v0.5.24

func (pool *NoChanPool) GetWorkerCnt() int64

func (*NoChanPool) ShutDown added in v0.5.24

func (pool *NoChanPool) ShutDown()

ShutDown closes the NoChanPool instance

func (*NoChanPool) Submit added in v0.5.24

func (pool *NoChanPool) Submit(t Task) (Future, error)

Submit executes the specified task, and returns the FutureResult and error info

func (*NoChanPool) SubmitFunc added in v0.5.24

func (pool *NoChanPool) SubmitFunc(f func() interface{}) (Future, error)

SubmitFunc creates a funcWrapper instance with the specified function and calls the Submit function

type NoncurrentVersionExpiration

type NoncurrentVersionExpiration struct {
	XMLName        xml.Name `xml:"NoncurrentVersionExpiration"`
	NoncurrentDays int      `xml:"NoncurrentDays"`
}

NoncurrentVersionExpiration defines noncurrentVersion expiration property in LifecycleRule

type NoncurrentVersionTransition

type NoncurrentVersionTransition struct {
	XMLName        xml.Name         `xml:"NoncurrentVersionTransition"`
	NoncurrentDays int              `xml:"NoncurrentDays"`
	StorageClass   StorageClassType `xml:"StorageClass"`
}

NoncurrentVersionTransition defines noncurrentVersion transition property in LifecycleRule

type ObjectInfo added in v0.5.24

type ObjectInfo struct {
	XMLName      xml.Name `xml:"ObjectInfo"`
	LastModified int64    `xml:"LastModified"`
	Size         int64    `xml:"Size"`
	ETag         string   `xml:"ETag"`
}

ObjectInfo defines download object info

type ObjectOperationInput

type ObjectOperationInput struct {
	Bucket                  string
	Key                     string
	ACL                     AclType
	GrantReadId             string
	GrantReadAcpId          string
	GrantWriteAcpId         string
	GrantFullControlId      string
	StorageClass            StorageClassType
	WebsiteRedirectLocation string
	Expires                 int64
	SseHeader               ISseHeader
	Metadata                map[string]string
}

ObjectOperationInput defines the object operation properties

type ObjectToDelete

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

ObjectToDelete defines the object property in DeleteObjectsInput

type ObsClient

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

ObsClient defines OBS client.

func New

func New(ak, sk, endpoint string, configurers ...Configurer) (*ObsClient, error)

New creates a new ObsClient instance.

func (ObsClient) AbortMultipartUpload

func (obsClient ObsClient) AbortMultipartUpload(input *AbortMultipartUploadInput) (output *BaseModel, err error)

AbortMultipartUpload aborts a multipart upload in a specified bucket by using the multipart upload ID.

func (ObsClient) AbortMultipartUploadWithSignedUrl

func (obsClient ObsClient) AbortMultipartUploadWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

AbortMultipartUploadWithSignedUrl aborts a multipart upload in a specified bucket by using the multipart upload ID with the specified signed url and signed request headers

func (ObsClient) Close

func (obsClient ObsClient) Close()

Close closes ObsClient.

func (ObsClient) CompleteMultipartUpload

func (obsClient ObsClient) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (output *CompleteMultipartUploadOutput, err error)

CompleteMultipartUpload combines the uploaded parts in a specified bucket by using the multipart upload ID.

func (ObsClient) CompleteMultipartUploadWithSignedUrl

func (obsClient ObsClient) CompleteMultipartUploadWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *CompleteMultipartUploadOutput, err error)

CompleteMultipartUploadWithSignedUrl combines the uploaded parts in a specified bucket by using the multipart upload ID with the specified signed url and signed request headers and data

func (ObsClient) CopyObject

func (obsClient ObsClient) CopyObject(input *CopyObjectInput) (output *CopyObjectOutput, err error)

CopyObject creates a copy for an existing object.

You can use this API to create a copy for an object in a specified bucket.

func (ObsClient) CopyObjectWithSignedUrl

func (obsClient ObsClient) CopyObjectWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *CopyObjectOutput, err error)

CopyObjectWithSignedUrl creates a copy for an existing object with the specified signed url and signed request headers

func (ObsClient) CopyPart

func (obsClient ObsClient) CopyPart(input *CopyPartInput) (output *CopyPartOutput, err error)

CopyPart copy a part to a specified bucket by using a specified multipart upload ID.

After a multipart upload is initialized, you can use this API to copy a part to a specified bucket by using the multipart upload ID.

func (ObsClient) CopyPartWithSignedUrl

func (obsClient ObsClient) CopyPartWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *CopyPartOutput, err error)

CopyPartWithSignedUrl copy a part to a specified bucket by using a specified multipart upload ID with the specified signed url and signed request headers

func (ObsClient) CreateBrowserBasedSignature

func (obsClient ObsClient) CreateBrowserBasedSignature(input *CreateBrowserBasedSignatureInput) (output *CreateBrowserBasedSignatureOutput, err error)

func (ObsClient) CreateBucket

func (obsClient ObsClient) CreateBucket(input *CreateBucketInput) (output *BaseModel, err error)

CreateBucket creates a bucket.

You can use this API to create a bucket and name it as you specify. The created bucket name must be unique in OBS.

func (ObsClient) CreateBucketWithSignedUrl

func (obsClient ObsClient) CreateBucketWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

CreateBucketWithSignedUrl creates bucket with the specified signed url and signed request headers and data

func (ObsClient) CreateSignedUrl

func (obsClient ObsClient) CreateSignedUrl(input *CreateSignedUrlInput) (output *CreateSignedUrlOutput, err error)

CreateSignedUrl creates signed url with the specified CreateSignedUrlInput, and returns the CreateSignedUrlOutput and error

func (ObsClient) DeleteBucket

func (obsClient ObsClient) DeleteBucket(bucketName string) (output *BaseModel, err error)

DeleteBucket deletes a bucket.

You can use this API to delete a bucket. The bucket to be deleted must be empty (containing no objects, noncurrent object versions, or part fragments).

func (ObsClient) DeleteBucketCors

func (obsClient ObsClient) DeleteBucketCors(bucketName string) (output *BaseModel, err error)

DeleteBucketCors deletes CORS rules of a bucket.

You can use this API to delete the CORS rules of a specified bucket.

func (ObsClient) DeleteBucketCorsWithSignedUrl

func (obsClient ObsClient) DeleteBucketCorsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

DeleteBucketCorsWithSignedUrl deletes CORS rules of a bucket with the specified signed url and signed request headers

func (ObsClient) DeleteBucketEncryption added in v0.5.0

func (obsClient ObsClient) DeleteBucketEncryption(bucketName string) (output *BaseModel, err error)

DeleteBucketEncryption deletes the encryption configuration of a bucket.

You can use this API to delete the encryption configuration of a bucket.

func (ObsClient) DeleteBucketEncryptionWithSignedURL added in v0.5.24

func (obsClient ObsClient) DeleteBucketEncryptionWithSignedURL(signedURL string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

DeleteBucketEncryptionWithSignedURL deletes bucket encryption setting of a bucket with the specified signed url and signed request headers

func (ObsClient) DeleteBucketLifecycleConfiguration

func (obsClient ObsClient) DeleteBucketLifecycleConfiguration(bucketName string) (output *BaseModel, err error)

DeleteBucketLifecycleConfiguration deletes lifecycle rules of a bucket.

You can use this API to delete all lifecycle rules of a bucket.

func (ObsClient) DeleteBucketLifecycleConfigurationWithSignedUrl

func (obsClient ObsClient) DeleteBucketLifecycleConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

DeleteBucketLifecycleConfigurationWithSignedUrl deletes lifecycle rules of a bucket with the specified signed url and signed request headers

func (ObsClient) DeleteBucketPolicy

func (obsClient ObsClient) DeleteBucketPolicy(bucketName string) (output *BaseModel, err error)

DeleteBucketPolicy deletes the bucket policy.

You can use this API to delete the policy of a bucket.

func (ObsClient) DeleteBucketPolicyWithSignedUrl

func (obsClient ObsClient) DeleteBucketPolicyWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

DeleteBucketPolicyWithSignedUrl deletes the bucket policy with the specified signed url and signed request headers

func (ObsClient) DeleteBucketTagging

func (obsClient ObsClient) DeleteBucketTagging(bucketName string) (output *BaseModel, err error)

DeleteBucketTagging deletes bucket tags.

You can use this API to delete the tags of a specified bucket.

func (ObsClient) DeleteBucketTaggingWithSignedUrl

func (obsClient ObsClient) DeleteBucketTaggingWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

DeleteBucketTaggingWithSignedUrl deletes bucket tags with the specified signed url and signed request headers

func (ObsClient) DeleteBucketWebsiteConfiguration

func (obsClient ObsClient) DeleteBucketWebsiteConfiguration(bucketName string) (output *BaseModel, err error)

DeleteBucketWebsiteConfiguration deletes the website hosting settings of a bucket.

You can use this API to delete the website hosting settings of a bucket.

func (ObsClient) DeleteBucketWebsiteConfigurationWithSignedUrl

func (obsClient ObsClient) DeleteBucketWebsiteConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

DeleteBucketWebsiteConfigurationWithSignedUrl deletes the website hosting settings of a bucket with the specified signed url and signed request headers

func (ObsClient) DeleteBucketWithSignedUrl

func (obsClient ObsClient) DeleteBucketWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

DeleteBucketWithSignedUrl deletes bucket with the specified signed url and signed request headers

func (ObsClient) DeleteObject

func (obsClient ObsClient) DeleteObject(input *DeleteObjectInput) (output *DeleteObjectOutput, err error)

DeleteObject deletes an object.

You can use this API to delete an object from a specified bucket.

func (ObsClient) DeleteObjectWithSignedUrl

func (obsClient ObsClient) DeleteObjectWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *DeleteObjectOutput, err error)

DeleteObjectWithSignedUrl deletes an object with the specified signed url and signed request headers

func (ObsClient) DeleteObjects

func (obsClient ObsClient) DeleteObjects(input *DeleteObjectsInput) (output *DeleteObjectsOutput, err error)

DeleteObjects deletes objects in a batch.

You can use this API to batch delete objects from a specified bucket.

func (ObsClient) DeleteObjectsWithSignedUrl

func (obsClient ObsClient) DeleteObjectsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *DeleteObjectsOutput, err error)

DeleteObjectsWithSignedUrl deletes objects in a batch with the specified signed url and signed request headers and data

func (ObsClient) DownloadFile added in v0.5.24

func (obsClient ObsClient) DownloadFile(input *DownloadFileInput) (output *GetObjectMetadataOutput, err error)

DownloadFile resume downloads.

This API is an encapsulated and enhanced version of partial download, and aims to eliminate large file download failures caused by poor network conditions and program breakdowns.

func (ObsClient) GetBucketAcl

func (obsClient ObsClient) GetBucketAcl(bucketName string) (output *GetBucketAclOutput, err error)

GetBucketAcl gets the bucket ACL.

You can use this API to obtain a bucket ACL.

func (ObsClient) GetBucketAclWithSignedUrl

func (obsClient ObsClient) GetBucketAclWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketAclOutput, err error)

GetBucketAclWithSignedUrl gets the bucket ACL with the specified signed url and signed request headers

func (ObsClient) GetBucketCors

func (obsClient ObsClient) GetBucketCors(bucketName string) (output *GetBucketCorsOutput, err error)

GetBucketCors gets CORS rules of a bucket.

You can use this API to obtain the CORS rules of a specified bucket.

func (ObsClient) GetBucketCorsWithSignedUrl

func (obsClient ObsClient) GetBucketCorsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketCorsOutput, err error)

GetBucketCorsWithSignedUrl gets CORS rules of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketEncryption added in v0.5.0

func (obsClient ObsClient) GetBucketEncryption(bucketName string) (output *GetBucketEncryptionOutput, err error)

GetBucketEncryption gets the encryption configuration of a bucket.

You can use this API to obtain the encryption configuration of a bucket.

func (ObsClient) GetBucketEncryptionWithSignedURL added in v0.5.24

func (obsClient ObsClient) GetBucketEncryptionWithSignedURL(signedURL string, actualSignedRequestHeaders http.Header) (output *GetBucketEncryptionOutput, err error)

GetBucketEncryptionWithSignedURL gets bucket encryption setting of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketLifecycleConfiguration

func (obsClient ObsClient) GetBucketLifecycleConfiguration(bucketName string) (output *GetBucketLifecycleConfigurationOutput, err error)

GetBucketLifecycleConfiguration gets lifecycle rules of a bucket.

You can use this API to obtain the lifecycle rules of a bucket.

func (ObsClient) GetBucketLifecycleConfigurationWithSignedUrl

func (obsClient ObsClient) GetBucketLifecycleConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketLifecycleConfigurationOutput, err error)

GetBucketLifecycleConfigurationWithSignedUrl gets lifecycle rules of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketLocation

func (obsClient ObsClient) GetBucketLocation(bucketName string) (output *GetBucketLocationOutput, err error)

GetBucketLocation gets the location of a bucket.

You can use this API to obtain the bucket location.

func (ObsClient) GetBucketLocationWithSignedUrl

func (obsClient ObsClient) GetBucketLocationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketLocationOutput, err error)

GetBucketLocationWithSignedUrl gets the location of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketLoggingConfiguration

func (obsClient ObsClient) GetBucketLoggingConfiguration(bucketName string) (output *GetBucketLoggingConfigurationOutput, err error)

GetBucketLoggingConfiguration gets the logging settings of a bucket.

You can use this API to obtain the access logging settings of a bucket.

func (ObsClient) GetBucketLoggingConfigurationWithSignedUrl

func (obsClient ObsClient) GetBucketLoggingConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketLoggingConfigurationOutput, err error)

GetBucketLoggingConfigurationWithSignedUrl gets the logging settings of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketMetadata

func (obsClient ObsClient) GetBucketMetadata(input *GetBucketMetadataInput) (output *GetBucketMetadataOutput, err error)

GetBucketMetadata gets the metadata of a bucket.

You can use this API to send a HEAD request to a bucket to obtain the bucket metadata such as the storage class and CORS rules (if set).

func (ObsClient) GetBucketMetadataWithSignedUrl

func (obsClient ObsClient) GetBucketMetadataWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketMetadataOutput, err error)

GetBucketMetadataWithSignedUrl gets the metadata of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketNotification

func (obsClient ObsClient) GetBucketNotification(bucketName string) (output *GetBucketNotificationOutput, err error)

GetBucketNotification gets event notification settings of a bucket.

You can use this API to obtain the event notification configuration of a bucket.

func (ObsClient) GetBucketNotificationWithSignedUrl

func (obsClient ObsClient) GetBucketNotificationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketNotificationOutput, err error)

GetBucketNotificationWithSignedUrl gets event notification settings of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketPolicy

func (obsClient ObsClient) GetBucketPolicy(bucketName string) (output *GetBucketPolicyOutput, err error)

GetBucketPolicy gets the bucket policy.

You can use this API to obtain the policy of a bucket.

func (ObsClient) GetBucketPolicyWithSignedUrl

func (obsClient ObsClient) GetBucketPolicyWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketPolicyOutput, err error)

GetBucketPolicyWithSignedUrl gets the bucket policy with the specified signed url and signed request headers

func (ObsClient) GetBucketQuota

func (obsClient ObsClient) GetBucketQuota(bucketName string) (output *GetBucketQuotaOutput, err error)

GetBucketQuota gets the bucket quota.

You can use this API to obtain the bucket quota. Value 0 indicates that no upper limit is set for the bucket quota.

func (ObsClient) GetBucketQuotaWithSignedUrl

func (obsClient ObsClient) GetBucketQuotaWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketQuotaOutput, err error)

GetBucketQuotaWithSignedUrl gets the bucket quota with the specified signed url and signed request headers

func (ObsClient) GetBucketStorageInfo

func (obsClient ObsClient) GetBucketStorageInfo(bucketName string) (output *GetBucketStorageInfoOutput, err error)

GetBucketStorageInfo gets storage information about a bucket.

You can use this API to obtain storage information about a bucket, including the bucket size and number of objects in the bucket.

func (ObsClient) GetBucketStorageInfoWithSignedUrl

func (obsClient ObsClient) GetBucketStorageInfoWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketStorageInfoOutput, err error)

GetBucketStorageInfoWithSignedUrl gets storage information about a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketStoragePolicy

func (obsClient ObsClient) GetBucketStoragePolicy(bucketName string) (output *GetBucketStoragePolicyOutput, err error)

GetBucketStoragePolicy gets bucket storage class.

You can use this API to obtain the storage class of a bucket.

func (ObsClient) GetBucketStoragePolicyWithSignedUrl

func (obsClient ObsClient) GetBucketStoragePolicyWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketStoragePolicyOutput, err error)

GetBucketStoragePolicyWithSignedUrl gets bucket storage class with the specified signed url and signed request headers

func (ObsClient) GetBucketTagging

func (obsClient ObsClient) GetBucketTagging(bucketName string) (output *GetBucketTaggingOutput, err error)

GetBucketTagging gets bucket tags.

You can use this API to obtain the tags of a specified bucket.

func (ObsClient) GetBucketTaggingWithSignedUrl

func (obsClient ObsClient) GetBucketTaggingWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketTaggingOutput, err error)

GetBucketTaggingWithSignedUrl gets bucket tags with the specified signed url and signed request headers

func (ObsClient) GetBucketVersioning

func (obsClient ObsClient) GetBucketVersioning(bucketName string) (output *GetBucketVersioningOutput, err error)

GetBucketVersioning gets the versioning status of a bucket.

You can use this API to obtain the versioning status of a bucket.

func (ObsClient) GetBucketVersioningWithSignedUrl

func (obsClient ObsClient) GetBucketVersioningWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketVersioningOutput, err error)

GetBucketVersioningWithSignedUrl gets the versioning status of a bucket with the specified signed url and signed request headers

func (ObsClient) GetBucketWebsiteConfiguration

func (obsClient ObsClient) GetBucketWebsiteConfiguration(bucketName string) (output *GetBucketWebsiteConfigurationOutput, err error)

GetBucketWebsiteConfiguration gets the website hosting settings of a bucket.

You can use this API to obtain the website hosting settings of a bucket.

func (ObsClient) GetBucketWebsiteConfigurationWithSignedUrl

func (obsClient ObsClient) GetBucketWebsiteConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketWebsiteConfigurationOutput, err error)

GetBucketWebsiteConfigurationWithSignedUrl gets the website hosting settings of a bucket with the specified signed url and signed request headers

func (ObsClient) GetObject

func (obsClient ObsClient) GetObject(input *GetObjectInput) (output *GetObjectOutput, err error)

GetObject downloads object.

You can use this API to download an object in a specified bucket.

func (ObsClient) GetObjectAcl

func (obsClient ObsClient) GetObjectAcl(input *GetObjectAclInput) (output *GetObjectAclOutput, err error)

GetObjectAcl gets the ACL of an object.

You can use this API to obtain the ACL of an object in a specified bucket.

func (ObsClient) GetObjectAclWithSignedUrl

func (obsClient ObsClient) GetObjectAclWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetObjectAclOutput, err error)

GetObjectAclWithSignedUrl gets the ACL of an object with the specified signed url and signed request headers

func (ObsClient) GetObjectMetadata

func (obsClient ObsClient) GetObjectMetadata(input *GetObjectMetadataInput) (output *GetObjectMetadataOutput, err error)

GetObjectMetadata gets object metadata.

You can use this API to send a HEAD request to the object of a specified bucket to obtain its metadata.

func (ObsClient) GetObjectMetadataWithSignedUrl

func (obsClient ObsClient) GetObjectMetadataWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetObjectMetadataOutput, err error)

GetObjectMetadataWithSignedUrl gets object metadata with the specified signed url and signed request headers

func (ObsClient) GetObjectWithSignedUrl

func (obsClient ObsClient) GetObjectWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetObjectOutput, err error)

GetObjectWithSignedUrl downloads object with the specified signed url and signed request headers

func (ObsClient) HeadBucket

func (obsClient ObsClient) HeadBucket(bucketName string) (output *BaseModel, err error)

HeadBucket checks whether a bucket exists.

You can use this API to check whether a bucket exists.

func (ObsClient) HeadBucketWithSignedUrl

func (obsClient ObsClient) HeadBucketWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

HeadBucketWithSignedUrl checks whether a bucket exists with the specified signed url and signed request headers

func (ObsClient) HeadObject added in v0.5.24

func (obsClient ObsClient) HeadObject(input *HeadObjectInput) (output *BaseModel, err error)

HeadObject checks whether an object exists.

You can use this API to check whether an object exists.

func (ObsClient) HeadObjectWithSignedUrl added in v0.5.24

func (obsClient ObsClient) HeadObjectWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

HeadObjectWithSignedUrl checks whether an object exists with the specified signed url and signed request headers

func (ObsClient) InitiateMultipartUpload

func (obsClient ObsClient) InitiateMultipartUpload(input *InitiateMultipartUploadInput) (output *InitiateMultipartUploadOutput, err error)

InitiateMultipartUpload initializes a multipart upload.

func (ObsClient) InitiateMultipartUploadWithSignedUrl

func (obsClient ObsClient) InitiateMultipartUploadWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *InitiateMultipartUploadOutput, err error)

InitiateMultipartUploadWithSignedUrl initializes a multipart upload with the specified signed url and signed request headers

func (ObsClient) ListBuckets

func (obsClient ObsClient) ListBuckets(input *ListBucketsInput) (output *ListBucketsOutput, err error)

ListBuckets lists buckets.

You can use this API to obtain the bucket list. In the list, bucket names are displayed in lexicographical order.

func (ObsClient) ListBucketsWithSignedUrl

func (obsClient ObsClient) ListBucketsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListBucketsOutput, err error)

ListBucketsWithSignedUrl lists buckets with the specified signed url and signed request headers

func (ObsClient) ListMultipartUploads

func (obsClient ObsClient) ListMultipartUploads(input *ListMultipartUploadsInput) (output *ListMultipartUploadsOutput, err error)

ListMultipartUploads lists the multipart uploads.

You can use this API to list the multipart uploads that are initialized but not combined or aborted in a specified bucket.

func (ObsClient) ListMultipartUploadsWithSignedUrl

func (obsClient ObsClient) ListMultipartUploadsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListMultipartUploadsOutput, err error)

ListMultipartUploadsWithSignedUrl lists the multipart uploads that are initialized but not combined or aborted in a specified bucket with the specified signed url and signed request headers

func (ObsClient) ListObjects

func (obsClient ObsClient) ListObjects(input *ListObjectsInput) (output *ListObjectsOutput, err error)

ListObjects lists objects in a bucket.

You can use this API to list objects in a bucket. By default, a maximum of 1000 objects are listed.

func (ObsClient) ListObjectsWithSignedUrl

func (obsClient ObsClient) ListObjectsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListObjectsOutput, err error)

ListObjectsWithSignedUrl lists objects in a bucket with the specified signed url and signed request headers

func (ObsClient) ListParts

func (obsClient ObsClient) ListParts(input *ListPartsInput) (output *ListPartsOutput, err error)

ListParts lists the uploaded parts in a bucket by using the multipart upload ID.

func (ObsClient) ListPartsWithSignedUrl

func (obsClient ObsClient) ListPartsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListPartsOutput, err error)

ListPartsWithSignedUrl lists the uploaded parts in a bucket by using the multipart upload ID with the specified signed url and signed request headers

func (ObsClient) ListVersions

func (obsClient ObsClient) ListVersions(input *ListVersionsInput) (output *ListVersionsOutput, err error)

ListVersions lists versioning objects in a bucket.

You can use this API to list versioning objects in a bucket. By default, a maximum of 1000 versioning objects are listed.

func (ObsClient) ListVersionsWithSignedUrl

func (obsClient ObsClient) ListVersionsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListVersionsOutput, err error)

ListVersionsWithSignedUrl lists versioning objects in a bucket with the specified signed url and signed request headers

func (ObsClient) PutFile

func (obsClient ObsClient) PutFile(input *PutFileInput) (output *PutObjectOutput, err error)

PutFile uploads a file to the specified bucket.

func (ObsClient) PutFileWithSignedUrl

func (obsClient ObsClient) PutFileWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, sourceFile string) (output *PutObjectOutput, err error)

PutFileWithSignedUrl uploads a file to the specified bucket with the specified signed url and signed request headers and sourceFile path

func (ObsClient) PutObject

func (obsClient ObsClient) PutObject(input *PutObjectInput) (output *PutObjectOutput, err error)

PutObject uploads an object to the specified bucket.

func (ObsClient) PutObjectWithSignedUrl

func (obsClient ObsClient) PutObjectWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *PutObjectOutput, err error)

PutObjectWithSignedUrl uploads an object to the specified bucket with the specified signed url and signed request headers and data

func (ObsClient) Refresh

func (obsClient ObsClient) Refresh(ak, sk, securityToken string)

Refresh refreshes ak, sk and securityToken for obsClient.

func (ObsClient) RestoreObject

func (obsClient ObsClient) RestoreObject(input *RestoreObjectInput) (output *BaseModel, err error)

RestoreObject restores an object.

func (ObsClient) RestoreObjectWithSignedUrl

func (obsClient ObsClient) RestoreObjectWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

RestoreObjectWithSignedUrl restores an object with the specified signed url and signed request headers and data

func (ObsClient) SetBucketAcl

func (obsClient ObsClient) SetBucketAcl(input *SetBucketAclInput) (output *BaseModel, err error)

SetBucketAcl sets the bucket ACL.

You can use this API to set the ACL for a bucket.

func (ObsClient) SetBucketAclWithSignedUrl

func (obsClient ObsClient) SetBucketAclWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketAclWithSignedUrl sets the bucket ACL with the specified signed url and signed request headers and data

func (ObsClient) SetBucketCors

func (obsClient ObsClient) SetBucketCors(input *SetBucketCorsInput) (output *BaseModel, err error)

SetBucketCors sets CORS rules for a bucket.

You can use this API to set CORS rules for a bucket to allow client browsers to send cross-origin requests.

func (ObsClient) SetBucketCorsWithSignedUrl

func (obsClient ObsClient) SetBucketCorsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketCorsWithSignedUrl sets CORS rules for a bucket with the specified signed url and signed request headers and data

func (ObsClient) SetBucketEncryption added in v0.5.0

func (obsClient ObsClient) SetBucketEncryption(input *SetBucketEncryptionInput) (output *BaseModel, err error)

SetBucketEncryption sets the default server-side encryption for a bucket.

You can use this API to create or update the default server-side encryption for a bucket.

func (ObsClient) SetBucketEncryptionWithSignedURL added in v0.5.24

func (obsClient ObsClient) SetBucketEncryptionWithSignedURL(signedURL string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketEncryptionWithSignedURL sets bucket encryption setting for a bucket with the specified signed url and signed request headers and data

func (ObsClient) SetBucketLifecycleConfiguration

func (obsClient ObsClient) SetBucketLifecycleConfiguration(input *SetBucketLifecycleConfigurationInput) (output *BaseModel, err error)

SetBucketLifecycleConfiguration sets lifecycle rules for a bucket.

You can use this API to set lifecycle rules for a bucket, to periodically transit storage classes of objects and delete objects in the bucket.

func (ObsClient) SetBucketLifecycleConfigurationWithSignedUrl

func (obsClient ObsClient) SetBucketLifecycleConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketLifecycleConfigurationWithSignedUrl sets lifecycle rules for a bucket with the specified signed url and signed request headers and data

func (ObsClient) SetBucketLoggingConfiguration

func (obsClient ObsClient) SetBucketLoggingConfiguration(input *SetBucketLoggingConfigurationInput) (output *BaseModel, err error)

SetBucketLoggingConfiguration sets the bucket logging.

You can use this API to configure access logging for a bucket.

func (ObsClient) SetBucketLoggingConfigurationWithSignedUrl

func (obsClient ObsClient) SetBucketLoggingConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketLoggingConfigurationWithSignedUrl sets the bucket logging with the specified signed url and signed request headers and data

func (ObsClient) SetBucketNotification

func (obsClient ObsClient) SetBucketNotification(input *SetBucketNotificationInput) (output *BaseModel, err error)

SetBucketNotification sets event notification for a bucket.

You can use this API to configure event notification for a bucket. You will be notified of all specified operations performed on the bucket.

func (ObsClient) SetBucketNotificationWithSignedUrl

func (obsClient ObsClient) SetBucketNotificationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketNotificationWithSignedUrl sets event notification for a bucket with the specified signed url and signed request headers and data

func (ObsClient) SetBucketPolicy

func (obsClient ObsClient) SetBucketPolicy(input *SetBucketPolicyInput) (output *BaseModel, err error)

SetBucketPolicy sets the bucket policy.

You can use this API to set a bucket policy. If the bucket already has a policy, the policy will be overwritten by the one specified in this request.

func (ObsClient) SetBucketPolicyWithSignedUrl

func (obsClient ObsClient) SetBucketPolicyWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketPolicyWithSignedUrl sets the bucket policy with the specified signed url and signed request headers and data

func (ObsClient) SetBucketQuota

func (obsClient ObsClient) SetBucketQuota(input *SetBucketQuotaInput) (output *BaseModel, err error)

SetBucketQuota sets the bucket quota.

You can use this API to set the bucket quota. A bucket quota must be expressed in bytes and the maximum value is 2^63-1.

func (ObsClient) SetBucketQuotaWithSignedUrl

func (obsClient ObsClient) SetBucketQuotaWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketQuotaWithSignedUrl sets the bucket quota with the specified signed url and signed request headers and data

func (ObsClient) SetBucketStoragePolicy

func (obsClient ObsClient) SetBucketStoragePolicy(input *SetBucketStoragePolicyInput) (output *BaseModel, err error)

SetBucketStoragePolicy sets bucket storage class.

You can use this API to set storage class for bucket.

func (ObsClient) SetBucketStoragePolicyWithSignedUrl

func (obsClient ObsClient) SetBucketStoragePolicyWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketStoragePolicyWithSignedUrl sets bucket storage class with the specified signed url and signed request headers and data

func (ObsClient) SetBucketTagging

func (obsClient ObsClient) SetBucketTagging(input *SetBucketTaggingInput) (output *BaseModel, err error)

SetBucketTagging sets bucket tags.

You can use this API to set bucket tags.

func (ObsClient) SetBucketTaggingWithSignedUrl

func (obsClient ObsClient) SetBucketTaggingWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketTaggingWithSignedUrl sets bucket tags with the specified signed url and signed request headers and data

func (ObsClient) SetBucketVersioning

func (obsClient ObsClient) SetBucketVersioning(input *SetBucketVersioningInput) (output *BaseModel, err error)

SetBucketVersioning sets the versioning status for a bucket.

You can use this API to set the versioning status for a bucket.

func (ObsClient) SetBucketVersioningWithSignedUrl

func (obsClient ObsClient) SetBucketVersioningWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketVersioningWithSignedUrl sets the versioning status for a bucket with the specified signed url and signed request headers and data

func (ObsClient) SetBucketWebsiteConfiguration

func (obsClient ObsClient) SetBucketWebsiteConfiguration(input *SetBucketWebsiteConfigurationInput) (output *BaseModel, err error)

SetBucketWebsiteConfiguration sets website hosting for a bucket.

You can use this API to set website hosting for a bucket.

func (ObsClient) SetBucketWebsiteConfigurationWithSignedUrl

func (obsClient ObsClient) SetBucketWebsiteConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetBucketWebsiteConfigurationWithSignedUrl sets website hosting for a bucket with the specified signed url and signed request headers and data

func (ObsClient) SetObjectAcl

func (obsClient ObsClient) SetObjectAcl(input *SetObjectAclInput) (output *BaseModel, err error)

SetObjectAcl sets ACL for an object.

You can use this API to set the ACL for an object in a specified bucket.

func (ObsClient) SetObjectAclWithSignedUrl

func (obsClient ObsClient) SetObjectAclWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)

SetObjectAclWithSignedUrl sets ACL for an object with the specified signed url and signed request headers and data

func (ObsClient) SetObjectMetadata

func (obsClient ObsClient) SetObjectMetadata(input *SetObjectMetadataInput) (output *SetObjectMetadataOutput, err error)

SetObjectMetadata sets object metadata.

func (ObsClient) UploadFile added in v0.5.24

func (obsClient ObsClient) UploadFile(input *UploadFileInput) (output *CompleteMultipartUploadOutput, err error)

UploadFile resume uploads.

This API is an encapsulated and enhanced version of multipart upload, and aims to eliminate large file upload failures caused by poor network conditions and program breakdowns.

func (ObsClient) UploadPart

func (obsClient ObsClient) UploadPart(_input *UploadPartInput) (output *UploadPartOutput, err error)

UploadPart uploads a part to a specified bucket by using a specified multipart upload ID.

After a multipart upload is initialized, you can use this API to upload a part to a specified bucket by using the multipart upload ID. Except for the last uploaded part whose size ranges from 0 to 5 GB, sizes of the other parts range from 100 KB to 5 GB. The upload part ID ranges from 1 to 10000.

func (ObsClient) UploadPartWithSignedUrl

func (obsClient ObsClient) UploadPartWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *UploadPartOutput, err error)

UploadPartWithSignedUrl uploads a part to a specified bucket by using a specified multipart upload ID with the specified signed url and signed request headers and data

type ObsError

type ObsError struct {
	BaseModel
	Status   string
	XMLName  xml.Name `xml:"Error"`
	Code     string   `xml:"Code"`
	Message  string   `xml:"Message"`
	Resource string   `xml:"Resource"`
	HostId   string   `xml:"HostId"`
}

func (ObsError) Error

func (err ObsError) Error() string

type Owner

type Owner struct {
	XMLName     xml.Name `xml:"Owner"`
	ID          string   `xml:"ID"`
	DisplayName string   `xml:"DisplayName,omitempty"`
}

Owner defines owner properties

type Part

type Part struct {
	XMLName      xml.Name  `xml:"Part"`
	PartNumber   int       `xml:"PartNumber"`
	ETag         string    `xml:"ETag"`
	LastModified time.Time `xml:"LastModified,omitempty"`
	Size         int64     `xml:"Size,omitempty"`
}

Part defines the part properties

type PayerType added in v0.5.24

type PayerType string

PayerType defines type of payer

const (
	// BucketOwnerPayer type of payer: BucketOwner
	BucketOwnerPayer PayerType = "BucketOwner"

	// RequesterPayer type of payer: Requester
	RequesterPayer PayerType = "Requester"

	// Requester header for requester-Pays
	Requester PayerType = "requester"
)

type PermissionType

type PermissionType string
const (
	PermissionRead        PermissionType = "READ"
	PermissionWrite       PermissionType = "WRITE"
	PermissionReadAcp     PermissionType = "READ_ACP"
	PermissionWriteAcp    PermissionType = "WRITE_ACP"
	PermissionFullControl PermissionType = "FULL_CONTROL"
)

type Pool added in v0.5.24

type Pool interface {
	ShutDown()
	Submit(t Task) (Future, error)
	SubmitFunc(f func() interface{}) (Future, error)
	Execute(t Task)
	ExecuteFunc(f func() interface{})
	GetMaxWorkerCnt() int64
	AddMaxWorkerCnt(value int64) int64
	GetCurrentWorkingCnt() int64
	AddCurrentWorkingCnt(value int64) int64
	GetWorkerCnt() int64
	AddWorkerCnt(value int64) int64
	EnableAutoTune()
}

Pool defines coroutine pool interface

func NewNochanPool added in v0.5.24

func NewNochanPool(maxWorkerCnt int) Pool

NewNochanPool creates a new NoChanPool instance

func NewRoutinePool added in v0.5.24

func NewRoutinePool(maxWorkerCnt, cacheCnt int) Pool

NewRoutinePool creates a RoutinePool instance

type ProtocolType

type ProtocolType string
const (
	ProtocolHttp  ProtocolType = "http"
	ProtocolHttps ProtocolType = "https"
)

type PutFileInput

type PutFileInput struct {
	PutObjectBasicInput
	SourceFile string
}

PutFileInput is the input parameter of PutFile function

type PutObjectBasicInput

type PutObjectBasicInput struct {
	ObjectOperationInput
	ContentType   string
	ContentMD5    string
	ContentLength int64
}

PutObjectBasicInput defines the basic object operation properties

type PutObjectInput

type PutObjectInput struct {
	PutObjectBasicInput
	Body io.Reader
}

PutObjectInput is the input parameter of PutObject function

type PutObjectOutput

type PutObjectOutput struct {
	BaseModel
	VersionId    string
	SseHeader    ISseHeader
	StorageClass StorageClassType
	ETag         string
}

PutObjectOutput is the result of PutObject function

type Redirect

type Redirect struct {
	XMLName              xml.Name     `xml:"Redirect"`
	Protocol             ProtocolType `xml:"Protocol,omitempty"`
	HostName             string       `xml:"HostName,omitempty"`
	ReplaceKeyPrefixWith string       `xml:"ReplaceKeyPrefixWith,omitempty"`
	ReplaceKeyWith       string       `xml:"ReplaceKeyWith,omitempty"`
	HttpRedirectCode     string       `xml:"HttpRedirectCode,omitempty"`
}

Redirect defines redirect in RoutingRule

type RedirectAllRequestsTo

type RedirectAllRequestsTo struct {
	XMLName  xml.Name     `xml:"RedirectAllRequestsTo"`
	Protocol ProtocolType `xml:"Protocol,omitempty"`
	HostName string       `xml:"HostName"`
}

RedirectAllRequestsTo defines redirect in BucketWebsiteConfiguration

type RestoreObjectInput

type RestoreObjectInput struct {
	Bucket    string          `xml:"-"`
	Key       string          `xml:"-"`
	VersionId string          `xml:"-"`
	XMLName   xml.Name        `xml:"RestoreRequest"`
	Days      int             `xml:"Days"`
	Tier      RestoreTierType `xml:"GlacierJobParameters>Tier,omitempty"`
}

RestoreObjectInput is the input parameter of RestoreObject function

type RestoreTierType

type RestoreTierType string
const (
	RestoreTierExpedited RestoreTierType = "Expedited"
	RestoreTierStandard  RestoreTierType = "Standard"
	RestoreTierBulk      RestoreTierType = "Bulk"
)

type RoutinePool added in v0.5.24

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

RoutinePool defines the coroutine pool struct

func (*RoutinePool) AddCurrentWorkingCnt added in v0.5.24

func (pool *RoutinePool) AddCurrentWorkingCnt(value int64) int64

func (*RoutinePool) AddMaxWorkerCnt added in v0.5.24

func (pool *RoutinePool) AddMaxWorkerCnt(value int64) int64

AddMaxWorkerCnt sets the maxWorkerCnt field's value and returns it

func (*RoutinePool) AddWorkerCnt added in v0.5.24

func (pool *RoutinePool) AddWorkerCnt(value int64) int64

func (*RoutinePool) CompareAndSwapCurrentWorkingCnt added in v0.5.24

func (pool *RoutinePool) CompareAndSwapCurrentWorkingCnt(oldValue, newValue int64) bool

func (*RoutinePool) EnableAutoTune added in v0.5.24

func (pool *RoutinePool) EnableAutoTune()

EnableAutoTune sets the autoTune enabled

func (*RoutinePool) Execute added in v0.5.24

func (pool *RoutinePool) Execute(t Task)

Execute pushes the specified task to the dispatchQueue

func (*RoutinePool) ExecuteFunc added in v0.5.24

func (pool *RoutinePool) ExecuteFunc(f func() interface{})

ExecuteFunc creates a funcWrapper instance with the specified function and calls the Execute function

func (*RoutinePool) GetCurrentWorkingCnt added in v0.5.24

func (pool *RoutinePool) GetCurrentWorkingCnt() int64

func (*RoutinePool) GetMaxWorkerCnt added in v0.5.24

func (pool *RoutinePool) GetMaxWorkerCnt() int64

func (*RoutinePool) GetWorkerCnt added in v0.5.24

func (pool *RoutinePool) GetWorkerCnt() int64

func (*RoutinePool) ShutDown added in v0.5.24

func (pool *RoutinePool) ShutDown()

ShutDown closes the RoutinePool instance

func (*RoutinePool) Submit added in v0.5.24

func (pool *RoutinePool) Submit(t Task) (Future, error)

Submit pushes the specified task to the dispatchQueue, and returns the FutureResult and error info

func (*RoutinePool) SubmitFunc added in v0.5.24

func (pool *RoutinePool) SubmitFunc(f func() interface{}) (Future, error)

SubmitFunc creates a funcWrapper instance with the specified function and calls the Submit function

func (*RoutinePool) SubmitWithTimeout added in v0.5.24

func (pool *RoutinePool) SubmitWithTimeout(t Task, timeout int64) (Future, error)

SubmitWithTimeout pushes the specified task to the dispatchQueue, and returns the FutureResult and error info. Also takes a timeout value, will return ErrSubmitTimeout if it does't complete within that time.

type RoutingRule

type RoutingRule struct {
	XMLName   xml.Name  `xml:"RoutingRule"`
	Condition Condition `xml:"Condition,omitempty"`
	Redirect  Redirect  `xml:"Redirect"`
}

RoutingRule defines routing rules

type RuleStatusType

type RuleStatusType string
const (
	RuleStatusEnabled  RuleStatusType = "Enabled"
	RuleStatusDisabled RuleStatusType = "Disabled"
)

type SetBucketAclInput

type SetBucketAclInput struct {
	Bucket string  `xml:"-"`
	ACL    AclType `xml:"-"`
	AccessControlPolicy
}

SetBucketAclInput is the input parameter of SetBucketAcl function

type SetBucketCorsInput

type SetBucketCorsInput struct {
	Bucket string `xml:"-"`
	BucketCors
}

SetBucketCorsInput is the input parameter of SetBucketCors function

type SetBucketEncryptionInput added in v0.5.0

type SetBucketEncryptionInput struct {
	Bucket string `xml:"-"`
	BucketEncryptionConfiguration
}

SetBucketEncryptionInput is the input parameter of SetBucketEncryption function

type SetBucketLifecycleConfigurationInput

type SetBucketLifecycleConfigurationInput struct {
	Bucket string `xml:"-"`
	BucketLifecycleConfiguration
}

SetBucketLifecycleConfigurationInput is the input parameter of SetBucketLifecycleConfiguration function

type SetBucketLoggingConfigurationInput

type SetBucketLoggingConfigurationInput struct {
	Bucket string `xml:"-"`
	BucketLoggingStatus
}

SetBucketLoggingConfigurationInput is the input parameter of SetBucketLoggingConfiguration function

type SetBucketNotificationInput

type SetBucketNotificationInput struct {
	Bucket string `xml:"-"`
	BucketNotification
}

SetBucketNotificationInput is the input parameter of SetBucketNotification function

type SetBucketPolicyInput

type SetBucketPolicyInput struct {
	Bucket string
	Policy string
}

SetBucketPolicyInput is the input parameter of SetBucketPolicy function

type SetBucketQuotaInput

type SetBucketQuotaInput struct {
	Bucket string `xml:"-"`
	BucketQuota
}

SetBucketQuotaInput is the input parameter of SetBucketQuota function

type SetBucketStoragePolicyInput

type SetBucketStoragePolicyInput struct {
	Bucket string `xml:"-"`
	BucketStoragePolicy
}

SetBucketStoragePolicyInput is the input parameter of SetBucketStoragePolicy function

type SetBucketTaggingInput

type SetBucketTaggingInput struct {
	Bucket string `xml:"-"`
	BucketTagging
}

SetBucketTaggingInput is the input parameter of SetBucketTagging function

type SetBucketVersioningInput

type SetBucketVersioningInput struct {
	Bucket string `xml:"-"`
	BucketVersioningConfiguration
}

SetBucketVersioningInput is the input parameter of SetBucketVersioning function

type SetBucketWebsiteConfigurationInput

type SetBucketWebsiteConfigurationInput struct {
	Bucket string `xml:"-"`
	BucketWebsiteConfiguration
}

SetBucketWebsiteConfigurationInput is the input parameter of SetBucketWebsiteConfiguration function

type SetObjectAclInput

type SetObjectAclInput struct {
	Bucket    string  `xml:"-"`
	Key       string  `xml:"-"`
	VersionId string  `xml:"-"`
	ACL       AclType `xml:"-"`
	AccessControlPolicy
}

SetObjectAclInput is the input parameter of SetObjectAcl function

type SetObjectMetadataInput

type SetObjectMetadataInput struct {
	Bucket                  string
	Key                     string
	VersionId               string
	MetadataDirective       MetadataDirectiveType
	CacheControl            string
	ContentDisposition      string
	ContentEncoding         string
	ContentLanguage         string
	ContentType             string
	Expires                 string
	WebsiteRedirectLocation string
	StorageClass            StorageClassType
	Metadata                map[string]string
}

SetObjectMetadataInput is the input parameter of SetObjectMetadata function

type SetObjectMetadataOutput

type SetObjectMetadataOutput struct {
	BaseModel
	MetadataDirective       MetadataDirectiveType
	CacheControl            string
	ContentDisposition      string
	ContentEncoding         string
	ContentLanguage         string
	ContentType             string
	Expires                 string
	WebsiteRedirectLocation string
	StorageClass            StorageClassType
	Metadata                map[string]string
}

SetObjectMetadataOutput is the result of SetObjectMetadata function

type SignatureType

type SignatureType string
const (
	SignatureV2  SignatureType = "v2"
	SignatureV4  SignatureType = "v4"
	SignatureObs SignatureType = "OBS"
)

type SseCHeader

type SseCHeader struct {
	Encryption string
	Key        string
	KeyMD5     string
}

SseCHeader defines the SseC header

func (SseCHeader) GetEncryption

func (header SseCHeader) GetEncryption() string

GetEncryption gets the Encryption field value from SseCHeader

func (SseCHeader) GetKey

func (header SseCHeader) GetKey() string

GetKey gets the Key field value from SseCHeader

func (SseCHeader) GetKeyMD5

func (header SseCHeader) GetKeyMD5() string

GetKeyMD5 gets the KeyMD5 field value from SseCHeader

type SseKmsHeader

type SseKmsHeader struct {
	Encryption string
	Key        string
	// contains filtered or unexported fields
}

SseKmsHeader defines the SseKms header

func (SseKmsHeader) GetEncryption

func (header SseKmsHeader) GetEncryption() string

GetEncryption gets the Encryption field value from SseKmsHeader

func (SseKmsHeader) GetKey

func (header SseKmsHeader) GetKey() string

GetKey gets the Key field value from SseKmsHeader

type StorageClassType

type StorageClassType string
const (
	StorageClassStandard StorageClassType = "STANDARD"
	StorageClassWarm     StorageClassType = "WARM"
	StorageClassCold     StorageClassType = "COLD"
)

func ParseStringToStorageClassType

func ParseStringToStorageClassType(value string) (ret StorageClassType)

ParseStringToStorageClassType converts string value to StorageClassType value and returns it

type SubResourceType

type SubResourceType string
const (
	SubResourceStoragePolicy SubResourceType = "storagePolicy"
	SubResourceStorageClass  SubResourceType = "storageClass"
	SubResourceQuota         SubResourceType = "quota"
	SubResourceStorageInfo   SubResourceType = "storageinfo"
	SubResourceLocation      SubResourceType = "location"
	SubResourceAcl           SubResourceType = "acl"
	SubResourcePolicy        SubResourceType = "policy"
	SubResourceCors          SubResourceType = "cors"
	SubResourceVersioning    SubResourceType = "versioning"
	SubResourceWebsite       SubResourceType = "website"
	SubResourceLogging       SubResourceType = "logging"
	SubResourceLifecycle     SubResourceType = "lifecycle"
	SubResourceNotification  SubResourceType = "notification"
	SubResourceEncryption    SubResourceType = "encryption"
	SubResourceTagging       SubResourceType = "tagging"
	SubResourceDelete        SubResourceType = "delete"
	SubResourceVersions      SubResourceType = "versions"
	SubResourceUploads       SubResourceType = "uploads"
	SubResourceRestore       SubResourceType = "restore"
	SubResourceMetadata      SubResourceType = "metadata"
)

type Tag

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

Tag defines tag property in BucketTagging

type Task added in v0.5.24

type Task interface {
	Run() interface{}
}

Task defines interface with function: Run

type TempFileInfo added in v0.5.24

type TempFileInfo struct {
	XMLName     xml.Name `xml:"TempFileInfo"`
	TempFileUrl string   `xml:"TempFileUrl"`
	Size        int64    `xml:"Size"`
}

TempFileInfo defines temp download file properties

type TopicConfiguration

type TopicConfiguration struct {
	XMLName     xml.Name     `xml:"TopicConfiguration"`
	ID          string       `xml:"Id,omitempty"`
	Topic       string       `xml:"Topic"`
	Events      []EventType  `xml:"Event"`
	FilterRules []FilterRule `xml:"Filter>Object>FilterRule"`
}

TopicConfiguration defines the topic configuration

type Transition

type Transition struct {
	XMLName      xml.Name         `xml:"Transition"`
	Date         time.Time        `xml:"Date,omitempty"`
	Days         int              `xml:"Days,omitempty"`
	StorageClass StorageClassType `xml:"StorageClass"`
}

Transition defines transition property in LifecycleRule

type Upload

type Upload struct {
	XMLName      xml.Name         `xml:"Upload"`
	Key          string           `xml:"Key"`
	UploadId     string           `xml:"UploadId"`
	Initiated    time.Time        `xml:"Initiated"`
	StorageClass StorageClassType `xml:"StorageClass"`
	Owner        Owner            `xml:"Owner"`
	Initiator    Initiator        `xml:"Initiator"`
}

Upload defines multipart upload properties

type UploadCheckpoint added in v0.5.24

type UploadCheckpoint struct {
	XMLName     xml.Name         `xml:"UploadFileCheckpoint"`
	Bucket      string           `xml:"Bucket"`
	Key         string           `xml:"Key"`
	UploadId    string           `xml:"UploadId,omitempty"`
	UploadFile  string           `xml:"FileUrl"`
	FileInfo    FileStatus       `xml:"FileInfo"`
	UploadParts []UploadPartInfo `xml:"UploadParts>UploadPart"`
}

UploadCheckpoint defines the upload checkpoint file properties

type UploadFileInput added in v0.5.24

type UploadFileInput struct {
	ObjectOperationInput
	ContentType      string
	UploadFile       string
	PartSize         int64
	TaskNum          int
	EnableCheckpoint bool
	CheckpointFile   string
	EncodingType     string
}

UploadFileInput is the input parameter of UploadFile function

type UploadPartInfo added in v0.5.24

type UploadPartInfo struct {
	XMLName     xml.Name `xml:"UploadPart"`
	PartNumber  int      `xml:"PartNumber"`
	Etag        string   `xml:"Etag"`
	PartSize    int64    `xml:"PartSize"`
	Offset      int64    `xml:"Offset"`
	IsCompleted bool     `xml:"IsCompleted"`
}

UploadPartInfo defines the upload part properties

type UploadPartInput

type UploadPartInput struct {
	Bucket     string
	Key        string
	PartNumber int
	UploadId   string
	ContentMD5 string
	SseHeader  ISseHeader
	Body       io.Reader
	SourceFile string
	Offset     int64
	PartSize   int64
}

UploadPartInput is the input parameter of UploadPart function

type UploadPartOutput

type UploadPartOutput struct {
	BaseModel
	PartNumber int
	ETag       string
	SseHeader  ISseHeader
}

UploadPartOutput is the result of UploadPart function

type Version

type Version struct {
	DeleteMarker
	XMLName xml.Name `xml:"Version"`
	ETag    string   `xml:"ETag"`
	Size    int64    `xml:"Size"`
}

Version defines the properties of versioning objects

type VersioningStatusType

type VersioningStatusType string
const (
	VersioningStatusEnabled   VersioningStatusType = "Enabled"
	VersioningStatusSuspended VersioningStatusType = "Suspended"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL