Documentation ¶
Index ¶
- func FileSize(f *os.File) int64
- func IoMd5(r io.Reader) (sum string, err error)
- func StringMd5(s string) string
- type BulkUpyun
- func (obj *BulkUpyun) DeleteDir(upyun_path string)
- func (obj *BulkUpyun) DeleteFile(upyun_path string)
- func (obj *BulkUpyun) DownloadDir(upyun_path string, file_path string)
- func (obj *BulkUpyun) DownloadFile(upyun_path, local_path string)
- func (obj *BulkUpyun) GetFileDate(upyun_path string) (date time.Time, err error)
- func (obj *BulkUpyun) GetFileSize(upyun_path string) (size uint64, err error)
- func (obj *BulkUpyun) GetFileType(upyun_path string) (file_type string, err error)
- func (obj *BulkUpyun) UploadDir(upyun_path, local_path string)
- func (obj *BulkUpyun) UploadFile(upyun_path, local_path string)
- type DirInfo
- type UpYun
- func (u *UpYun) DeleteFile(file string) error
- func (u *UpYun) GetBucketUsage() (float64, error)
- func (u *UpYun) GetFileInfo(file string) (m map[string]string, err error)
- func (u *UpYun) GetFolderUsage(path string) (float64, error)
- func (u *UpYun) GetWritedFileInfo(key string) string
- func (u *UpYun) MkDir(path string, autoMkdir bool) error
- func (u *UpYun) ReadDir(path string) ([]*DirInfo, error)
- func (u *UpYun) ReadFile(file string, outFile *os.File) error
- func (u *UpYun) RmDir(dir string) error
- func (u *UpYun) SetApiDomain(domain string)
- func (u *UpYun) SetContentMD5(str string)
- func (u *UpYun) SetFileSecret(str string)
- func (u *UpYun) SetTimeout(time int)
- func (u *UpYun) Version() string
- func (u *UpYun) WriteFile(filePath string, inFile *os.File, autoMkdir bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BulkUpyun ¶
type BulkUpyun struct { UpYun *UpYun Tm *kmgTask.LimitThreadTaskManager }
批量upyun操作
func (*BulkUpyun) DownloadDir ¶
resursive download a dir
func (*BulkUpyun) DownloadFile ¶
download a file
func (*BulkUpyun) GetFileDate ¶
func (*BulkUpyun) GetFileSize ¶
func (*BulkUpyun) GetFileType ¶
func (*BulkUpyun) UploadFile ¶
批量上传接口 upload a file
type UpYun ¶
func NewUpYun ¶
*
- 初始化 UpYun 存储接口
- @param bucketName 空间名称
- @param userName 操作员名称
- @param passWord 密码
- return UpYun object
func (*UpYun) GetFileInfo ¶
*
- 获取文件信息
- @param file 文件路径(包含文件名)
- return array('type': file | folder, 'size': file size, 'date': unix time) 或 nil
func (*UpYun) GetWritedFileInfo ¶
*
- 获取上传文件后的信息(仅图片空间有返回数据)
- @param key 信息字段名(x-upyun-width、x-upyun-height、x-upyun-frames、x-upyun-file-type)
- return string or ""
func (*UpYun) ReadFile ¶
*
- 读取文件
- @param file 文件路径(包含文件名)
- @param outFile 可传递文件IO数据流(结果返回true or false)
- return error
func (*UpYun) SetApiDomain ¶
* * 切换 API 接口的域名 * @param domain { 默认 v0.api.upyun.com 自动识别,
v1.api.upyun.com 电信, v2.api.upyun.com 联通, v3.api.upyun.com 移动 }
* return 无
func (*UpYun) SetContentMD5 ¶
*
- 设置待上传文件的 Content-MD5 值(如又拍云服务端收到的文件MD5值与用户设置的不一致,
- 将回报 406 Not Acceptable 错误)
- @param str (文件 MD5 校验码)
- return 无
func (*UpYun) SetFileSecret ¶
*
- 设置待上传文件的 访问密钥(注意:仅支持图片空!,设置密钥后,无法根据原文件URL直接访问,需带 URL 后面加上 (缩略图间隔标志符+密钥) 进行访问)
- 如缩略图间隔标志符为 ! ,密钥为 bac,上传文件路径为 /folder/test.jpg ,那么该图片的对外访问地址为: http://空间域名/folder/test.jpg!bac
- @param $str (文件 MD5 校验码)
- return null;
Click to show internal directories.
Click to hide internal directories.