Documentation
¶
Overview ¶
Package bucket is for buckets * * Author: CZ cz.theng@gmail.com
Package bucket is for buckets
Index ¶
- Constants
- func CloseLogging(name, location string) (ossapiError *ossapi.Error)
- func Create(name, location, permission string) (ossapiError *ossapi.Error)
- func CreateDefault(name string) (ossapiError *ossapi.Error)
- func Delete(name, location string) (ossapiError *ossapi.Error)
- func DeleteLifecycle(name, location string) (ossapiError *ossapi.Error)
- func DeleteLogging(name, location string) (ossapiError *ossapi.Error)
- func DeleteWebsite(name, location string) (ossapiError *ossapi.Error)
- func OpenLogging(name, location, targetBucket, targetPrefix string) (ossapiError *ossapi.Error)
- func QueryLocation(name string) (location string, ossapiError *ossapi.Error)
- func SetACL(name, location, permission string) (error *ossapi.Error)
- func SetLifecycle(name, location string, rules []RuleInfo) (ossapiError *ossapi.Error)
- func SetReferer(name, location string, enable bool, urls []string) (ossapiError *ossapi.Error)
- func SetWebsite(name, location, indexPage, errorPage string) (ossapiError *ossapi.Error)
- type ACLInfo
- type AccessControlListInfo
- type BucktsInfo
- type CloseLoggingInfo
- type CommonInfo
- type ContentInfo
- type CreateBucketConfiguration
- type ExpirationDateInfo
- type ExpirationDaysInfo
- type IndexInfo
- type KeyInfo
- type LifecycleConfiguration
- type LocationInfo
- type LoggingInfo
- type LoggingStatus
- type OpenLoggingInfo
- type OwnerInfo
- type RefererConfigurationInfo
- type RefererListInfo
- type RuleInfo
- type WebsiteInfo
Constants ¶
const ( //LHangzhou is Hangzhou LHangzhou = "oss-cn-hangzhou" //LShenzhen is Shenzhen LShenzhen = "oss-cn-shenzhen" //LBeijing is Beijing LBeijing = "oss-cn-beijing" //LQingdao is Qingdao LQingdao = "oss-cn-qingdao" //LShanghai is Shanghai LShanghai = "oss-cn-shanghai" //LHongKong is HongKong LHongKong = "oss-cn-hongkong" //LSiliconValley is SiliconValley LSiliconValley = "oss-us-west-1" // LSingapore is Singapore LSingapore = "oss-ap-southeast-1" // PPrivate is private PPrivate = "private" // PPublicReadOnly is public-read PPublicReadOnly = "public-read" // PPublicRW is public-read-write PPublicRW = "public-read-write" )
Location and Permission
const ( LifecycleStatsEnable = "Enabled" LifecycleStatsDisable = "Disabled" )
const define
Variables ¶
This section is empty.
Functions ¶
func CloseLogging ¶
CloseLogging Close bucket's logging @param name: name of bucket @param locaton: location of bucket @return ossapiError: nil on success
func Create ¶
Create Bucket with name/location and permission location is list above permission now can be three value @param name : name of bucket @param permission : permission of bucket . it is P_XXX @return ossapiError : nil on success
func CreateDefault ¶
CreateDefault Create Bucket with default
func Delete ¶
Delete bucket @param name: bucket's name @param location : bucket's location @return : nil on Success else ossapi.Error
func DeleteLifecycle ¶
DeleteLifecycle delete Bucket's Lifecycle. All lifecycle rules will be delete @param name : bucket's Name @param location: bucket's Location @return : nil on Success else ossapi.Error
func DeleteLogging ¶
DeleteLogging delete bucket's logging option @param name: bucket's name @param location : bucket's location @return : nil on Success else ossapi.Error
func DeleteWebsite ¶
DeleteWebsite delete bucket's website infomation @param name: bucket's name @param location : bucket's location @return : nil on Success else ossapi.Error
func OpenLogging ¶
OpenLogging Open bucket's logging @param name: name of bucket @param locaton: location of bucket @param targetBucket: target bucket to store log @param targetPrefix: object's prefix name of logging file @return ossapiError: nil on success
func QueryLocation ¶
QueryLocation Query bucket's location @param name: name of bucket @return location : location name of bucket @return ossapiError : nil on success
func SetACL ¶
SetACL Set bucket's ACL info @param name : name of bucket @param permission : permisson to set @return ossapiError : nil on success
func SetLifecycle ¶
SetLifecycle Set bucket's lifecycle @param name : name of bucket @param location : location of bucket @param rules : rules to set @return ossapiError : nil on success
func SetReferer ¶
SetReferer Set Referer of bucket @param name : name of bucket @param location: locaton of bucket @param enable : wheather allow white access @param url: urls list @return ossapiError: nil on success
func SetWebsite ¶
SetWebsite Set bucket's website @param name: name of bucket @param location: location of bucket @param indexPage : index page @param errorPage : 404 error page @return ossapiError : nil on success
Types ¶
type ACLInfo ¶
type ACLInfo struct { XMLName xml.Name `xml:"AccessControlPolicy"` Owner OwnerInfo AccessControlList AccessControlListInfo }
ACLInfo is ACL XML wraper
type AccessControlListInfo ¶
type AccessControlListInfo struct {
Grant string
}
AccessControlListInfo is ACL real value
type BucktsInfo ¶
type BucktsInfo struct { XMLName xml.Name `xml:"ListBucketResult"` Name string `xml:"Name"` Prefix string `xml:"Prefix"` Marker string `xml:"Marker"` MaxKeys int `xml:"MaxKeys"` EncodingType string `xml:"encoding-type"` IsTruncated bool `xml:"IsTruncated"` Contents []ContentInfo CommonPrefixes CommonInfo `xml:"CommonPrefixes"` }
BucktsInfo is bucket's meta struct
func QueryObjects ¶
func QueryObjects(name, location string, prefix, marker, delimiter, encodingType string, maxKeys int) (info *BucktsInfo, ossapiError *ossapi.Error)
QueryObjects Query all objects of a bucket @param name : name of bucket @param location: location of bucket @param prefix: select valied prefix @param marker: marker after this will be return @param delimiter: valied delimiter, common prefix @param encoding: encoding of content @param maxKeys : at most maxKeys items will return @return info : objects' info @return ossapiError : nil on success
type CloseLoggingInfo ¶
CloseLoggingInfo is Close Logginginfo
type ContentInfo ¶
type ContentInfo struct { Key string LastModified string ETag string Type string Size string StorageClass string Owner service.Owner }
ContentInfo is bucket's conetent info
type CreateBucketConfiguration ¶
type CreateBucketConfiguration struct { XMLName xml.Name `xml:"CreateBucketConfiguration"` LocationConstraint string `xml:"LocationConstraint"` }
CreateBucketConfiguration Requestion's XML Content
type ExpirationDateInfo ¶
type ExpirationDateInfo struct {
Date string
}
ExpirationDateInfo is the real Date
type ExpirationDaysInfo ¶
type ExpirationDaysInfo struct {
Days uint
}
ExpirationDaysInfo is the real Days
type LifecycleConfiguration ¶
type LifecycleConfiguration struct { XMLName xml.Name `xml:"LifecycleConfiguration"` Rule []RuleInfo }
LifecycleConfiguration is Lifecycle XML info
type LocationInfo ¶
type LocationInfo struct { XMLName xml.Name `xml:"LocationConstraint"` Location string `xml:",chardata"` }
LocationInfo is locaiton struct
type LoggingInfo ¶
LoggingInfo is Logging info
func QueryLogging ¶
func QueryLogging(name, location string) (info *LoggingInfo, ossapiError *ossapi.Error)
QueryLogging Query bucket's Logging info @param name: name of bucket @param location: location of bucket @return info : Logging info of bucket @return ossapiError : nil on success
type LoggingStatus ¶
type LoggingStatus struct { XMLName xml.Name `xml:"BucketLoggingStatus"` LoggingEnabled LoggingInfo }
LoggingStatus is logging status struct
type OpenLoggingInfo ¶
type OpenLoggingInfo struct { XMLName xml.Name `xml:"BucketLoggingStatus"` LoggingEnabled LoggingInfo `xml:"LoggingEnabled"` }
OpenLoggingInfo is Open Loggign info
type RefererConfigurationInfo ¶
type RefererConfigurationInfo struct { XMLName xml.Name `xml:"RefererConfiguration"` AllowEmptyReferer bool `xml:"AllowEmptyReferer"` RefererList RefererListInfo `xml:"RefererList"` }
RefererConfigurationInfo is a XML continer
func QueryReferer ¶
func QueryReferer(name, location string) (info *RefererConfigurationInfo, ossapiError *ossapi.Error)
QueryReferer Query Referer info of buckets @param name : name of bucket @param location: location of bucket @return info : referer info of bucket @return ossapiError : nil on success
type RefererListInfo ¶
type RefererListInfo struct {
Referer []string
}
RefererListInfo is a Referer list
type RuleInfo ¶
type RuleInfo struct { ID string Prefix string Status string Expiration ExpirationDaysInfo }
RuleInfo is Rule info
type WebsiteInfo ¶
type WebsiteInfo struct { XMLName xml.Name `xml:"WebsiteConfiguration"` IndexDocument IndexInfo `xml:"IndexDocument"` ErrorDocument KeyInfo `xml:"ErrorDocument"` }
WebsiteInfo is website info xml wraper
func QueryWebsite ¶
func QueryWebsite(name, location string) (info *WebsiteInfo, ossapiError *ossapi.Error)
QueryWebsite Query bucket's website info @param name: name of bucket @param location : location of bucket @return info : website info of bucket @return ossapiError : nil on success
Source Files
¶
- delete_bucket.go
- delete_bucket_lifecycle.go
- delete_bucket_logging.go
- delete_bucket_website.go
- doc.go
- get_bucket.go
- get_bucket_acl.go
- get_bucket_lifecycle.go
- get_bucket_location.go
- get_bucket_logging.go
- get_bucket_referer.go
- get_bucket_website.go
- put_bucket.go
- put_bucket_acl.go
- put_bucket_lifecycle.go
- put_bucket_logging.go
- put_bucket_referer.go
- put_bucket_website.go