Documentation ¶
Index ¶
- Constants
- func IsNotExist(err error) bool
- func IsNotModified(err error) bool
- func IsTooManyRequests(err error) bool
- type CommitTasksConfig
- type CompleteMultipartUploadConfig
- type CopyObjectConfig
- type DeleteObjectConfig
- type Error
- type FileInfo
- type FormUploadConfig
- type FormUploadResp
- type GetObjectConfig
- type GetObjectsConfig
- type InitMultipartUploadConfig
- type InitMultipartUploadResult
- type JsonFileInfo
- type JsonFiles
- type ListMultipartConfig
- type ListMultipartPartsConfig
- type ListMultipartUploadResult
- type ListUploadedPartsResult
- type LiveauditCancelTask
- type LiveauditCreateTask
- type ModifyMetadataConfig
- type MoveObjectConfig
- type MultipartUploadFile
- type MultipartUploadedPart
- type PurgeAuthConfig
- type PutObjectConfig
- type RESTAuthConfig
- type SyncCommonTask
- type UnifiedAuthConfig
- type UpYun
- func (up *UpYun) CommitSyncTasks(commitTask interface{}) (result map[string]interface{}, err error)
- func (up *UpYun) CommitTasks(config *CommitTasksConfig) (taskIds []string, err error)
- func (up *UpYun) CompleteMultipartUpload(initResult *InitMultipartUploadResult, config *CompleteMultipartUploadConfig) error
- func (up *UpYun) Copy(config *CopyObjectConfig) error
- func (up *UpYun) Delete(config *DeleteObjectConfig) error
- func (up *UpYun) FormUpload(config *FormUploadConfig) (*FormUploadResp, error)
- func (up *UpYun) Get(config *GetObjectConfig) (fInfo *FileInfo, err error)
- func (up *UpYun) GetInfo(path string) (*FileInfo, error)
- func (up *UpYun) GetProgress(taskIds []string) (result map[string]int, err error)
- func (up *UpYun) GetResult(taskIds []string) (result map[string]interface{}, err error)
- func (up *UpYun) InitMultipartUpload(config *InitMultipartUploadConfig) (*InitMultipartUploadResult, error)
- func (up *UpYun) List(config *GetObjectsConfig) error
- func (up *UpYun) ListMultipartParts(intiResult *InitMultipartUploadResult, config *ListMultipartPartsConfig) (*ListUploadedPartsResult, error)
- func (up *UpYun) ListMultipartUploads(config *ListMultipartConfig) (*ListMultipartUploadResult, error)
- func (u *UpYun) MakeFormAuth(policy string) string
- func (u *UpYun) MakeProcessAuth(kwargs map[string]string) string
- func (u *UpYun) MakePurgeAuth(config *PurgeAuthConfig) string
- func (u *UpYun) MakeRESTAuth(config *RESTAuthConfig) string
- func (u *UpYun) MakeUnifiedAuth(config *UnifiedAuthConfig) string
- func (up *UpYun) Mkdir(path string) error
- func (up *UpYun) ModifyMetadata(config *ModifyMetadataConfig) error
- func (up *UpYun) Move(config *MoveObjectConfig) error
- func (up *UpYun) Purge(urls []string) (fails []string, err error)
- func (up *UpYun) Put(config *PutObjectConfig) (err error)
- func (up *UpYun) SetHTTPClient(httpc *http.Client)
- func (up *UpYun) UploadPart(initResult *InitMultipartUploadResult, part *UploadPartConfig) error
- func (up *UpYun) Usage() (n int64, err error)
- func (up *UpYun) UseDeprecatedApi()
- type UpYunConfig
- type UpYunPutReader
- type UploadPartConfig
Constants ¶
View Source
const ( DefaultPartSize = 1024 * 1024 MaxPartNum = 10000 )
Variables ¶
This section is empty.
Functions ¶
func IsNotExist ¶
func IsNotModified ¶
func IsTooManyRequests ¶
Types ¶
type CommitTasksConfig ¶
type CompleteMultipartUploadConfig ¶
type CompleteMultipartUploadConfig struct {
Md5 string
}
type CopyObjectConfig ¶
type DeleteObjectConfig ¶
type Error ¶
type FormUploadConfig ¶
type FormUploadConfig struct { LocalPath string SaveKey string ExpireAfterSec int64 NotifyUrl string Apps []map[string]interface{} Options map[string]interface{} }
func (*FormUploadConfig) Format ¶
func (config *FormUploadConfig) Format()
type FormUploadResp ¶
type FormUploadResp struct { Code int `json:"code"` Msg string `json:"message"` Url string `json:"url"` Timestamp int64 `json:"time"` ImgWidth int `json:"image-width"` ImgHeight int `json:"image-height"` ImgFrames int `json:"image-frames"` ImgType string `json:"image-type"` Sign string `json:"sign"` Taskids []string `json:"task_ids"` }
type GetObjectConfig ¶
type GetObjectConfig struct { Path string // Headers contains custom http header, like User-Agent. Headers map[string]string LocalPath string Writer io.Writer }
GetObjectConfig provides a configuration to Get method.
type GetObjectsConfig ¶
type GetObjectsConfig struct { Path string Headers map[string]string ObjectsChan chan *FileInfo QuitChan chan bool MaxListObjects int MaxListTries int // MaxListLevel: depth of recursion MaxListLevel int // DescOrder: whether list objects by desc-order DescOrder bool // contains filtered or unexported fields }
GetObjectConfig provides a configuration to List method.
type JsonFileInfo ¶
type JsonFiles ¶
type JsonFiles struct { Files []*JsonFileInfo `json:"files"` Iter string `json:"iter"` }
type ListMultipartConfig ¶
type ListMultipartPartsConfig ¶
type ListMultipartPartsConfig struct {
BeginID int
}
type ListMultipartUploadResult ¶
type ListMultipartUploadResult struct {
Files []*MultipartUploadFile `json:"files"`
}
type ListUploadedPartsResult ¶
type ListUploadedPartsResult struct {
Parts []*MultipartUploadedPart `json:"parts"`
}
type LiveauditCancelTask ¶
type LiveauditCancelTask struct {
TaskId string
}
type LiveauditCreateTask ¶
type ModifyMetadataConfig ¶
type MoveObjectConfig ¶
type MultipartUploadFile ¶
type MultipartUploadedPart ¶
type PurgeAuthConfig ¶
type PutObjectConfig ¶
type PutObjectConfig struct { Path string LocalPath string Reader io.Reader Headers map[string]string UseMD5 bool UseResumeUpload bool // Append Api Deprecated // AppendContent bool ResumePartSize int64 MaxResumePutTries int }
PutObjectConfig provides a configuration to Put method.
type RESTAuthConfig ¶
type SyncCommonTask ¶
type UnifiedAuthConfig ¶
type UpYun ¶
type UpYun struct { UpYunConfig // contains filtered or unexported fields }
func NewUpYun ¶
func NewUpYun(config *UpYunConfig) *UpYun
func (*UpYun) CommitSyncTasks ¶
func (*UpYun) CommitTasks ¶
func (up *UpYun) CommitTasks(config *CommitTasksConfig) (taskIds []string, err error)
func (*UpYun) CompleteMultipartUpload ¶
func (up *UpYun) CompleteMultipartUpload(initResult *InitMultipartUploadResult, config *CompleteMultipartUploadConfig) error
func (*UpYun) Copy ¶
func (up *UpYun) Copy(config *CopyObjectConfig) error
func (*UpYun) Delete ¶
func (up *UpYun) Delete(config *DeleteObjectConfig) error
func (*UpYun) FormUpload ¶
func (up *UpYun) FormUpload(config *FormUploadConfig) (*FormUploadResp, error)
func (*UpYun) Get ¶
func (up *UpYun) Get(config *GetObjectConfig) (fInfo *FileInfo, err error)
TODO: maybe directory
func (*UpYun) GetProgress ¶
func (*UpYun) InitMultipartUpload ¶
func (up *UpYun) InitMultipartUpload(config *InitMultipartUploadConfig) (*InitMultipartUploadResult, error)
func (*UpYun) List ¶
func (up *UpYun) List(config *GetObjectsConfig) error
func (*UpYun) ListMultipartParts ¶
func (up *UpYun) ListMultipartParts(intiResult *InitMultipartUploadResult, config *ListMultipartPartsConfig) (*ListUploadedPartsResult, error)
func (*UpYun) ListMultipartUploads ¶
func (up *UpYun) ListMultipartUploads(config *ListMultipartConfig) (*ListMultipartUploadResult, error)
func (*UpYun) MakeFormAuth ¶
func (*UpYun) MakePurgeAuth ¶
func (u *UpYun) MakePurgeAuth(config *PurgeAuthConfig) string
func (*UpYun) MakeRESTAuth ¶
func (u *UpYun) MakeRESTAuth(config *RESTAuthConfig) string
func (*UpYun) MakeUnifiedAuth ¶
func (u *UpYun) MakeUnifiedAuth(config *UnifiedAuthConfig) string
func (*UpYun) ModifyMetadata ¶
func (up *UpYun) ModifyMetadata(config *ModifyMetadataConfig) error
func (*UpYun) Move ¶
func (up *UpYun) Move(config *MoveObjectConfig) error
func (*UpYun) Put ¶
func (up *UpYun) Put(config *PutObjectConfig) (err error)
func (*UpYun) SetHTTPClient ¶
func (*UpYun) UploadPart ¶
func (up *UpYun) UploadPart(initResult *InitMultipartUploadResult, part *UploadPartConfig) error
func (*UpYun) UseDeprecatedApi ¶
func (up *UpYun) UseDeprecatedApi()
type UpYunConfig ¶
type UpYunPutReader ¶
Click to show internal directories.
Click to hide internal directories.