Documentation
¶
Index ¶
- func BuildConnStr(storage_name, bucket_name, work_dir, endpoint, app_key, secret_key string) string
- func IsDir(fileObject *types.Object) bool
- type FileSys
- func (obj *FileSys) Copy(srcPath, desPath string) (err error)
- func (obj *FileSys) CopyDir(srcDir, dstPath string) (err error)
- func (obj *FileSys) CreateDir(path string) (err error)
- func (obj *FileSys) Delete(path string) (err error)
- func (obj *FileSys) DirAllFileName(path string) (names []string, err error)
- func (obj *FileSys) FileExist(path string) (exist bool)
- func (obj *FileSys) GetFileInfo(path string) (res *types.Object)
- func (obj *FileSys) ListAll(path string) (oi *types.ObjectIterator, err error)
- func (obj *FileSys) Read(path string, w io.Writer, pairs ...types.Pair) (n int64, err error)
- func (obj *FileSys) Relative(basepath, targpath string) (string, error)
- func (obj *FileSys) Write(path string, r io.Reader, size int64, pairs ...types.Pair) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConnStr ¶
BuildConnStr , 构建存储链接串 参数:
storage_name : 存储类型 bucket_name : 存储桶名称 work_dir : 工作目录,存在的话左侧加"/" endpoint : 端点 app_key : app_key secret_key : secret_key
返回值:
存储链接串
Types ¶
type FileSys ¶
type FileSys struct { //链接串 ConnStr string //地址访问前缀 AccessPrefix string // contains filtered or unexported fields }
func CreateFileSys ¶
CreateFileSys , 创建文件操作类 参数:
connStr : 存储链接串 logger : 日志类
返回值:
FileSys:文件操作类指针 error: 异常
func (*FileSys) DirAllFileName ¶
func (*FileSys) ListAll ¶
func (obj *FileSys) ListAll(path string) (oi *types.ObjectIterator, err error)
ListAll , 目录下所有文件对象,含子目录 参数:
path : 目录路径
返回值:
oi: 文件对象 error: 异常
Click to show internal directories.
Click to hide internal directories.