Documentation ¶
Index ¶
- Constants
- func BlockCount(fsize int64) int64
- func FOps(auth *utility.Auth, config *Config, client *http.Client, query string) (response *http.Response, err error)
- func InnerFOps(auth *utility.Auth, client *http.Client, url string, query string) (response *http.Response, err error)
- type AppendUpload
- type BucketManager
- func (this *BucketManager) AvInfo(av_url string) (response *http.Response, err error)
- func (this *BucketManager) AvInfo2(av_url string) (response *http.Response, err error)
- func (this *BucketManager) BucketStat(bucket_names string, startdate string, enddate string) (response *http.Response, err error)
- func (this *BucketManager) Copy(src string, dst string) (response *http.Response, err error)
- func (this *BucketManager) Decompression(bucket string, key string, format string, directory string, save_list string, ...) (response *http.Response, err error)
- func (this *BucketManager) Delete(bucket string, key string) (response *http.Response, err error)
- func (this *BucketManager) Exif(image_url string) (response *http.Response, err error)
- func (this *BucketManager) ImageInfo(image_url string) (response *http.Response, err error)
- func (this *BucketManager) List(bucket string, limit int, prefix string, mode int, marker string, ...) (response *http.Response, err error)
- func (this *BucketManager) ListBucket() (response *http.Response, err error)
- func (this *BucketManager) Move(src string, dst string) (response *http.Response, err error)
- func (this *BucketManager) PersistentStatus(persistent_id string) (response *http.Response, err error)
- func (this *BucketManager) Prefetch(bucket_file_keys string) (response *http.Response, err error)
- func (this *BucketManager) SetDeadline(bucket string, key string, deadline int, relevance int) (response *http.Response, err error)
- func (this *BucketManager) Stat(bucket string, key string) (response *http.Response, err error)
- type CommonResult
- type Config
- type CopyInfo
- type DeleteInfo
- type DeleteM3u8Info
- type DeletePrefixInfo
- type FetchInfo
- type FileManager
- func (this *FileManager) Copy(resource string, bucket string, key string, prefix string, notify_url string, ...) (response *http.Response, err error)
- func (this *FileManager) CopyMultiple(copy_info []CopyInfo, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) Delete(bucket string, key string, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) DeleteM3u8(bucket string, key string, deletets int, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) DeleteM3u8Multiple(delete_m3u8_info []DeleteM3u8Info, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) DeleteMultiple(delete_info []DeleteInfo, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) DeletePrefix(bucket string, prefix string, output string, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) DeletePrefixMultiple(delete_prefix_info []DeletePrefixInfo, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) Fetch(fetch_url string, bucket string, key string, prefix string, md5 string, ...) (response *http.Response, err error)
- func (this *FileManager) FetchMultiple(fetch_info []FetchInfo, notify_url string, force int, separate int) (response *http.Response, err error)
- func (this *FileManager) Move(resource string, bucket string, key string, prefix string, notify_url string, ...) (response *http.Response, err error)
- func (this *FileManager) MoveMultiple(move_info []MoveInfo, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) SetDeadline(bucket string, prefix string, deadline int, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) SetDeadlineMultiple(set_deadline_info []SetDeadlineInfo, notify_url string, separate int) (response *http.Response, err error)
- func (this *FileManager) Status(persistent_id string) (response *http.Response, err error)
- type ImageOp
- type Jobs
- type MoveInfo
- type PutExtra
- type Results
- type SetDeadlineInfo
- type SimpleUpload
- type SliceUpload
- func (this *SliceUpload) Bput(context string, offset int64, chunk []byte, upload_token string, key string) (response *http.Response, err error)
- func (this *SliceUpload) MakeBlock(block_size int64, block_order int64, chunk []byte, upload_token string, ...) (response *http.Response, err error)
- func (this *SliceUpload) MakeFile(size int64, key string, contexts []string, upload_token string, ...) (response *http.Response, err error)
- func (this *SliceUpload) SliceUploadFileBase(local_filename string, put_policy string, key string, put_extra *PutExtra, ...) (response *http.Response, err error)
- func (this *SliceUpload) UploadFile(local_filename string, put_policy string, key string, put_extra *PutExtra) (response *http.Response, err error)
- func (this *SliceUpload) UploadFileConcurrent(local_filename string, put_policy string, key string, put_extra *PutExtra, ...) (response *http.Response, err error)
- func (this *SliceUpload) UploadFileWithBlockSize(local_filename string, put_policy string, key string, put_extra *PutExtra, ...) (response *http.Response, err error)
- type SliceUploadResult
Constants ¶
const ( VERSION = "1.0.0.3" BLOCK_SIZE int = 4 * 1024 * 1024 )
const (
BlockSize = 1 << blockBits
)
const (
MAX_APPEND_SIZE = 2 * 1024 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppendUpload ¶
type AppendUpload struct {
// contains filtered or unexported fields
}
func NewAppendUpload ¶
func (*AppendUpload) AppendData ¶
type BucketManager ¶
type BucketManager struct {
// contains filtered or unexported fields
}
func NewBucketManager ¶
func (*BucketManager) AvInfo ¶
func (this *BucketManager) AvInfo(av_url string) (response *http.Response, err error)
获取影视频元数据(avinfo) https://wcs.chinanetcenter.com/document/API/ResourceManage/avinfo
func (*BucketManager) AvInfo2 ¶
func (this *BucketManager) AvInfo2(av_url string) (response *http.Response, err error)
获取音视频简单元数据(avinfo2) https://wcs.chinanetcenter.com/document/API/ResourceManage/avinfo2
func (*BucketManager) BucketStat ¶
func (this *BucketManager) BucketStat(bucket_names string, startdate string, enddate string) (response *http.Response, err error)
获取空间存储量(bucket stat) https://wcs.chinanetcenter.com/document/API/ResourceManage/bucketstat
bucket_names 格式:<bucket_name1>|<bucket_name2>|…… startdate 是 统计开始时间,格式为yyyy-mm-dd enddate 是 统计结束时间,格式为yyyy-mm-dd 注:查询的时间跨度最长为六个月
func (*BucketManager) Copy ¶
复制资源(copy) https://wcs.chinanetcenter.com/document/API/ResourceManage/copy
func (*BucketManager) Decompression ¶
func (this *BucketManager) Decompression(bucket string, key string, format string, directory string, save_list string, notify_url string, force int, separate int) (response *http.Response, err error)
文件解压缩 https://wcs.chinanetcenter.com/document/API/ResourceManage/decompression
func (*BucketManager) Delete ¶
删除文件(delete) https://wcs.chinanetcenter.com/document/API/ResourceManage/delete
func (*BucketManager) Exif ¶
func (this *BucketManager) Exif(image_url string) (response *http.Response, err error)
获取图片 EXIF 信息 https://wcs.chinanetcenter.com/document/API/ResourceManage/exif
func (*BucketManager) ImageInfo ¶
func (this *BucketManager) ImageInfo(image_url string) (response *http.Response, err error)
获取图片基本信息(imageInfo) https://wcs.chinanetcenter.com/document/API/ResourceManage/imageInfo
func (*BucketManager) List ¶
func (this *BucketManager) List(bucket string, limit int, prefix string, mode int, marker string, startTime string, endTime string) (response *http.Response, err error)
列举资源(list) https://wcs.chinanetcenter.com/document/API/ResourceManage/list
func (*BucketManager) ListBucket ¶
func (this *BucketManager) ListBucket() (response *http.Response, err error)
列举空间(list bucket) https://wcs.chinanetcenter.com/document/API/ResourceManage/listbucket
func (*BucketManager) Move ¶
移动资源(move) https://wcs.chinanetcenter.com/document/API/ResourceManage/move
func (*BucketManager) PersistentStatus ¶
func (this *BucketManager) PersistentStatus(persistent_id string) (response *http.Response, err error)
查询持久化处理状态(status) https://wcs.chinanetcenter.com/document/API/ResourceManage/PersistentStatus
func (*BucketManager) Prefetch ¶
func (this *BucketManager) Prefetch(bucket_file_keys string) (response *http.Response, err error)
更新镜像资源 https://wcs.chinanetcenter.com/document/API/ResourceManage/prefetch
bucket_file_keys 格式:空间名+":"+文件名1|文件名2|文件名3…
func (*BucketManager) SetDeadline ¶
func (this *BucketManager) SetDeadline(bucket string, key string, deadline int, relevance int) (response *http.Response, err error)
设置文件保存期限 https://wcs.chinanetcenter.com/document/API/ResourceManage/setdeadline
func (*BucketManager) Stat ¶
获取文件信息(stat) https://wcs.chinanetcenter.com/document/API/ResourceManage/stat
type CommonResult ¶
type Config ¶
func NewDefaultConfig ¶
func NewDefaultConfig() (config *Config)
func (*Config) GetManageUrlPrefix ¶
func (*Config) GetUploadUrlPrefix ¶
type DeleteInfo ¶
type DeleteM3u8Info ¶
type DeletePrefixInfo ¶
type FileManager ¶
type FileManager struct {
// contains filtered or unexported fields
}
func NewFileManager ¶
func (*FileManager) Copy ¶
func (this *FileManager) Copy(resource string, bucket string, key string, prefix string, notify_url string, separate int) (response *http.Response, err error)
复制资源(fmgr/copy) https://wcs.chinanetcenter.com/document/API/Fmgr/copy
func (*FileManager) CopyMultiple ¶
func (*FileManager) Delete ¶
func (this *FileManager) Delete(bucket string, key string, notify_url string, separate int) (response *http.Response, err error)
删除资源 https://wcs.chinanetcenter.com/document/API/Fmgr/delete Delete bucket:key
func (*FileManager) DeleteM3u8 ¶
func (this *FileManager) DeleteM3u8(bucket string, key string, deletets int, notify_url string, separate int) (response *http.Response, err error)
删除m3u8文件 https://wcs.chinanetcenter.com/document/API/Fmgr/deletem3u8
func (*FileManager) DeleteM3u8Multiple ¶
func (this *FileManager) DeleteM3u8Multiple(delete_m3u8_info []DeleteM3u8Info, notify_url string, separate int) (response *http.Response, err error)
func (*FileManager) DeleteMultiple ¶
func (this *FileManager) DeleteMultiple(delete_info []DeleteInfo, notify_url string, separate int) (response *http.Response, err error)
func (*FileManager) DeletePrefix ¶
func (this *FileManager) DeletePrefix(bucket string, prefix string, output string, notify_url string, separate int) (response *http.Response, err error)
按前缀删除资源 https://wcs.chinanetcenter.com/document/API/Fmgr/deletePrefix
func (*FileManager) DeletePrefixMultiple ¶
func (this *FileManager) DeletePrefixMultiple(delete_prefix_info []DeletePrefixInfo, notify_url string, separate int) (response *http.Response, err error)
func (*FileManager) Fetch ¶
func (this *FileManager) Fetch(fetch_url string, bucket string, key string, prefix string, md5 string, decompression string, notify_url string, force int, separate int) (response *http.Response, err error)
抓取资源(fmgr/fetch) https://wcs.chinanetcenter.com/document/API/Fmgr/fetch Copy resource to bucket:key
func (*FileManager) FetchMultiple ¶
func (*FileManager) Move ¶
func (this *FileManager) Move(resource string, bucket string, key string, prefix string, notify_url string, separate int) (response *http.Response, err error)
移动资源 https://wcs.chinanetcenter.com/document/API/Fmgr/move Move resource to bucket:key
func (*FileManager) MoveMultiple ¶
func (*FileManager) SetDeadline ¶
func (this *FileManager) SetDeadline(bucket string, prefix string, deadline int, notify_url string, separate int) (response *http.Response, err error)
批量修改文件保存期限 https://wcs.chinanetcenter.com/document/API/Fmgr/setdeadline
func (*FileManager) SetDeadlineMultiple ¶
func (this *FileManager) SetDeadlineMultiple(set_deadline_info []SetDeadlineInfo, notify_url string, separate int) (response *http.Response, err error)
func (*FileManager) Status ¶
func (this *FileManager) Status(persistent_id string) (response *http.Response, err error)
fmgr任务查询(fmgr/status) https://wcs.chinanetcenter.com/document/API/Fmgr/status
type ImageOp ¶
type ImageOp struct {
// contains filtered or unexported fields
}
func NewImageOp ¶
func (*ImageOp) ImageDetect ¶
func (this *ImageOp) ImageDetect(image string, _type string, bucket string) (response *http.Response, err error)
图片鉴定 https://wcs.chinanetcenter.com/document/API/Image-op/imageDetect type: porn-鉴黄,terror-暴恐,political-政治人物识别
type PutExtra ¶
type PutExtra struct { Params map[string]string // 上传可选参数字典,参数名次以 x: 开头 MimeType string // 指定文件的 MimeType Deadline int // 文件保存期限。超过保存天数文件自动删除,单位:天。例如:1、2、3……注:0表示尽快删除,上传文件时建议不配置为0 }
func NewDefaultPutExtra ¶
func NewDefaultPutExtra() (put_extra *PutExtra)
func NewPutExtra ¶
type SetDeadlineInfo ¶
type SimpleUpload ¶
type SimpleUpload struct {
// contains filtered or unexported fields
}
func NewSimpleUpload ¶
func (*SimpleUpload) UploadData ¶
func (this *SimpleUpload) UploadData(data []byte, put_policy string, key string, put_extra *PutExtra) (response *http.Response, err error)
<summary> 上传数据 putPolicy 中的 JSON 字符串是严格模式,不允许最后一个元素后面有逗号 https://stackoverflow.com/questions/201782/can-you-use-a-trailing-comma-in-a-json-object 请确保 JSON 字符串的正确性和紧凑性,最好用 JSON 库生成,而不要自己用字符串拼接。 </summary> <param name="data">待上传的数据</param> <param name="put_policy">上传策略数据,JSON 字符串</param> <param name="key">可选,要保存的key</param> <param name="put_extra">可选,上传可选设置</param> <returns>上传数据后的返回结果</returns>
func (*SimpleUpload) UploadFile ¶
type SliceUpload ¶
type SliceUpload struct {
// contains filtered or unexported fields
}
func NewSliceUpload ¶
func (*SliceUpload) SliceUploadFileBase ¶
func (this *SliceUpload) SliceUploadFileBase(local_filename string, put_policy string, key string, put_extra *PutExtra, block_size int, pool_size int) (response *http.Response, err error)
* block_size 分块大小,单位为MB,必须为4的倍数 pool_size 块并发限制数,并发上传块的数量