Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Storer ¶
type Storer interface {
// 引擎名
Name() string
ErrIsNotExist(err error) bool
// FileDir 文件夹物理路径
FileDir(subpath string) string
// URLDir 文件夹网址路径
URLDir(subpath string) string
// Put 保存文件
Put(dst string, src io.Reader, size int64) (savePath string, viewURL string, err error)
// Get 获取文件
Get(file string) (io.ReadCloser, error)
// Exists 文件是否存在
Exists(file string) (bool, error)
// FileInfo 文件信息
FileInfo(file string) (os.FileInfo, error)
// SendFile 输出文件到浏览器
SendFile(ctx echo.Context, file string) error
// Delete 删除文件
Delete(file string) error
// DeleteDir 删除目录
DeleteDir(dir string) error
// Move 移动文件
Move(src, dst string) error
// PublicURL 文件物理路径转网址
PublicURL(dst string) string
// URLToFile 网址转文件存储路径(非完整路径)
URLToFile(viewURL string) string
// URLToPath 网址转文件路径(完整路径)
URLToPath(viewURL string) string
// 根网址(末尾不含"/")
SetBaseURL(baseURL string)
BaseURL() string
// FixURL 修正网址
FixURL(content string, embedded ...bool) string
// Close 关闭连接
Close() error
}
Storer 文件存储引擎接口
Click to show internal directories.
Click to hide internal directories.