Documentation ¶
Overview ¶
Package object is for object * * Author: CZ cz.theng@gmail.com
Index ¶
- Constants
- func Create(objName, bucketName, location string, objInfo *Info) (ossapiError *ossapi.Error)
- func Delete(objName, bucketName, location string) (ossapiError *ossapi.Error)
- func Query(objName, bucketName, location string, condInfo *ConditionInfo, ...) (data []byte, ossapiError *ossapi.Error)
- func QueryACL(objName, bucketName, location string) (info *bucket.ACLInfo, ossapiError *ossapi.Error)
- func SetACL(objName, bucketName, location, permission string) (error *ossapi.Error)
- type AppendObjInfo
- type AppendObjRspInfo
- type BriefConnInfo
- type BriefInfo
- type ConditionInfo
- type CopyConditionInfo
- type CopyInfo
- type CopyResultInfo
- type DeleteObjInfo
- type DeleteObjRstInfo
- type Info
- type KeyInfo
- type OverrideInfo
- type RspObjInfo
Constants ¶
const ( //COPY will not replace if dest is exist COPY = "COPY" // REPLACE wiil repalce . REPLACE = "REPLACE" )
enmu
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create an new object @param objName : name of object @param bucketName : name of bucket @param locaton : location of bucket @param objInfo : object's info @retun ossapiError : nil on success
func Delete ¶
Delete Delete an ojbect @param objName : name of object @param bucketName : name of bucket @param locaton : location of bucket @retun ossapiError : nil on success
func Query ¶
func Query(objName, bucketName, location string, condInfo *ConditionInfo, overrideInfo *OverrideInfo) (data []byte, ossapiError *ossapi.Error)
Query an object 's data or download @param objName : name of object @param bucketName : name of bucket @param locaton : location of bucket @param condInfo : condition to query @param overrideInfo : controller which to return @return data: object's data @retun ossapiError : nil on success
func QueryACL ¶
func QueryACL(objName, bucketName, location string) (info *bucket.ACLInfo, ossapiError *ossapi.Error)
QueryACL Query bucket's ACL info @param objName : name of object @param bucketName : name of bucket @param locaton : location of bucket @return info: ACL info @retun ossapiError : nil on success
Types ¶
type AppendObjInfo ¶
AppendObjInfo is Append Info
type AppendObjRspInfo ¶
type AppendObjRspInfo struct { Possition uint64 // contains filtered or unexported fields }
AppendObjRspInfo is Resopnse Info
func Append ¶
func Append(objName, bucketName, location string, objInfo *AppendObjInfo) (rstInfo *AppendObjRspInfo, ossapiError *ossapi.Error)
Append Create a Appendable object @param objName : name of object @param bucketName : name of bucket @param locaton : location of bucket @param objInfo : object meta info @return rstInfo : possition and crc of data @retun ossapiError : nil on success
type BriefConnInfo ¶
type BriefConnInfo struct { ModifiedSince string UnmodifiedSince string MatchEtag string NotMatchEtag string }
BriefConnInfo is Conndtition info
type BriefInfo ¶ added in v1.0.1
type BriefInfo struct { ObjectType string Type string LastModifed string ETag string Length uint64 }
BriefInfo is Brief Info
func QueryMeta ¶
func QueryMeta(objName, bucketName, location string, info *BriefConnInfo) (briefInfo *BriefInfo, ossapiError *ossapi.Error)
QueryMeta Query object's meta info @param objName : name of object @param bucketName : name of bucket @param locaton : location of bucket @param info: conndtion to controll return @return briefInfo : breif info of object @retun ossapiError : nil on success
type ConditionInfo ¶
type ConditionInfo struct { Range string LastModify string LastUnModify string ETag string ETagMatched bool }
ConditionInfo is condition info
type CopyConditionInfo ¶
CopyConditionInfo is copy condition
type CopyInfo ¶
type CopyInfo struct { ObjectName string BucketName string Location string Source string Directive string Encryption string ACL string }
CopyInfo is Copy Info with source and dest
type CopyResultInfo ¶
type CopyResultInfo struct { XMLName xml.Name `xml:"CopyObjectResult"` ETag string `xml:"ETag"` LastModified string `xml:"LastModified"` }
CopyResultInfo is return XML info
func Copy ¶
func Copy(copyInfo *CopyInfo, copyConnInfo *CopyConditionInfo) (rstInfo *CopyResultInfo, ossapiError *ossapi.Error)
Copy a object to creat a bucket @param copyInfo : source and dest object and bucket @param copyConnInfo : conndition to copy @return rstInfo: return info @return ossapiError : nil on success
type DeleteObjInfo ¶
type DeleteObjInfo struct { XMLName xml.Name `xml:"Delete"` Quiet bool `xml:"Quiet"` Object []KeyInfo }
DeleteObjInfo is Delete Info
type DeleteObjRstInfo ¶
type DeleteObjRstInfo struct { XMLName xml.Name `xml:"DeleteResult"` Deleted []KeyInfo `xml:"Deleted"` }
DeleteObjRstInfo is Response info
func DeleteObjects ¶
func DeleteObjects(bucketName, location string, info *DeleteObjInfo) (rstInfo *DeleteObjRstInfo, ossapiError *ossapi.Error)
DeleteObjects Delte serveral object @param bucketName : name of bucket @param locaton : location of bucket @param info : list of objcets @return rstInfo : return deleted objects @return ossapiError: nil on success
type Info ¶ added in v1.0.1
type Info struct { CacheControl string ContentDisposition string ContentEncoding string Expires string Encryption string ACL string Body []byte Type string }
Info is object's info