object

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package object is for object * * Author: CZ cz.theng@gmail.com

Index

Constants

View Source
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

func Create(objName, bucketName, location string, objInfo *Info) (ossapiError *ossapi.Error)

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

func Delete(objName, bucketName, location string) (ossapiError *ossapi.Error)

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

func SetACL

func SetACL(objName, bucketName, location, permission string) (error *ossapi.Error)

SetACL Set Object's ACL info @param objName : name of object @param bucketName : name of bucket @param locaton : location of bucket @retun ossapiError : nil on success

Types

type AppendObjInfo

type AppendObjInfo struct {
	Info
	Position uint64
}

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

type CopyConditionInfo struct {
	ETAG         string
	Date         string
	LastModify   string
	LastUnModify string
}

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

type KeyInfo

type KeyInfo struct {
	Key string
}

KeyInfo is the real key info

type OverrideInfo

type OverrideInfo struct {
	Type         string
	Language     string
	Expires      string
	CacheControl string
	Disposition  string
	Encoding     string
}

OverrideInfo is Override option

type RspObjInfo

type RspObjInfo struct {
	CntType      string
	LastModified string
	ETag         string
	Ranges       string
	Type         string
	Length       int
	Data         []byte
}

RspObjInfo is Response info

Jump to

Keyboard shortcuts

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