本文整理汇总了Golang中github.com/qiniu/api/rs.Client类的典型用法代码示例。如果您正苦于以下问题:Golang Client类的具体用法?Golang Client怎么用?Golang Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Client类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: BatchCopy
func BatchCopy(client rs.Client, entries []CopyEntryPath) (ret []BatchItemRet, err error) {
b := make([]string, len(entries))
for i, e := range entries {
b[i] = rs.URICopy(e.SrcBucket, e.SrcKey, e.DestBucket, e.DestKey)
}
err = client.Batch(nil, &ret, b)
return
}
示例2: BatchDelete
func BatchDelete(client rs.Client, entries []rs.EntryPath) (ret []BatchItemRet, err error) {
b := make([]string, len(entries))
for i, e := range entries {
b[i] = rs.URIDelete(e.Bucket, e.Key)
}
err = client.Batch(nil, &ret, b)
return
}
示例3: BatchRename
func BatchRename(client rs.Client, entries []RenameEntryPath) (ret []BatchItemRet, err error) {
b := make([]string, len(entries))
for i, e := range entries {
b[i] = rs.URIMove(e.Bucket, e.OldKey, e.Bucket, e.NewKey)
}
err = client.Batch(nil, &ret, b)
return
}
示例4: BatchChgm
func BatchChgm(client rs.Client, entries []ChgmEntryPath) (ret []BatchItemRet, err error) {
b := make([]string, len(entries))
for i, e := range entries {
b[i] = rs.URIChangeMime(e.Bucket, e.Key, e.MimeType)
}
err = client.Batch(nil, &ret, b)
return
}
示例5: qiniuDeleteImage
func qiniuDeleteImage(fileName string) error {
var client rs.Client
client = rs.New(nil)
err := client.Delete(nil, models.QiniuScope, fileName)
if err != nil {
revel.ERROR.Println("rs.Delete failed:", err)
}
return err
}