mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-17 16:12:42 +08:00
update
This commit is contained in:
21
file_store/file_store.go
Normal file
21
file_store/file_store.go
Normal file
@ -0,0 +1,21 @@
|
||||
package filestore
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
func New() {
|
||||
f, err := os.Open("")
|
||||
|
||||
_ = err
|
||||
_ = f
|
||||
|
||||
}
|
||||
|
||||
func Store(name string, reader io.Reader) error {
|
||||
|
||||
return errors.New("abc")
|
||||
|
||||
}
|
6
file_store/oss/oss.go
Normal file
6
file_store/oss/oss.go
Normal file
@ -0,0 +1,6 @@
|
||||
package oss
|
||||
|
||||
// add two int
|
||||
func Add(a, b int) {
|
||||
|
||||
}
|
38
file_store/readme.md
Normal file
38
file_store/readme.md
Normal file
@ -0,0 +1,38 @@
|
||||
# 文件存储组件
|
||||
|
||||
1. 支持磁盘,OSS,FTP等
|
||||
2. 支持自定义存储
|
||||
3. 支持同时存储到不同的存储目标
|
||||
|
||||
创建文件存储
|
||||
|
||||
```GO
|
||||
|
||||
New().WithStore(LocalDisk("D:\abc"))
|
||||
|
||||
|
||||
```
|
||||
|
||||
删除文件
|
||||
|
||||
```GO
|
||||
|
||||
filestore.Delete("filename")
|
||||
|
||||
```
|
||||
|
||||
文件移动
|
||||
|
||||
```GO
|
||||
|
||||
filestore.Move("old", "new")
|
||||
|
||||
```
|
||||
|
||||
文件重命名
|
||||
|
||||
```GO
|
||||
|
||||
filestore.Rename("old", "new")
|
||||
|
||||
```
|
Reference in New Issue
Block a user