Documentation ¶
Index ¶
- Constants
- type Filesystem
- func (f *Filesystem) BaseURL() string
- func (f *Filesystem) Close() error
- func (f *Filesystem) Delete(dstFile string) error
- func (f *Filesystem) DeleteDir(dstDir string) error
- func (f *Filesystem) ErrIsNotExist(err error) bool
- func (f *Filesystem) Exists(file string) (bool, error)
- func (f *Filesystem) FileDir(subpath string) string
- func (f *Filesystem) FileInfo(file string) (os.FileInfo, error)
- func (f *Filesystem) FixURL(content string, embedded ...bool) string
- func (f *Filesystem) FixURLWithParams(content string, values url.Values, embedded ...bool) string
- func (f *Filesystem) Get(dstFile string) (io.ReadCloser, error)
- func (f *Filesystem) Move(src, dst string) error
- func (f *Filesystem) Name() string
- func (f *Filesystem) PublicURL(dstFile string) string
- func (f *Filesystem) Put(dstFile string, src io.Reader, size int64) (savePath string, viewURL string, err error)
- func (f *Filesystem) SendFile(ctx echo.Context, file string) error
- func (f *Filesystem) SetBaseURL(baseURL string)
- func (f *Filesystem) URLDir(subpath string) string
- func (f *Filesystem) URLToFile(publicURL string) string
- func (f *Filesystem) URLToPath(publicURL string) string
- func (f *Filesystem) URLWithParams(rawURL string, values url.Values) string
Constants ¶
View Source
const Name = `local`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filesystem ¶
type Filesystem struct { context.Context `json:"-" xml:"-"` Subdir string // contains filtered or unexported fields }
Filesystem 文件系统存储引擎
func NewFilesystem ¶
func NewFilesystem(ctx context.Context, subdir string, baseURLs ...string) *Filesystem
func (*Filesystem) DeleteDir ¶
func (f *Filesystem) DeleteDir(dstDir string) error
DeleteDir 删除文件夹及其内部文件
func (*Filesystem) ErrIsNotExist ¶
func (f *Filesystem) ErrIsNotExist(err error) bool
func (*Filesystem) FileInfo ¶
func (f *Filesystem) FileInfo(file string) (os.FileInfo, error)
FileInfo 获取文件信息
func (*Filesystem) FixURL ¶
func (f *Filesystem) FixURL(content string, embedded ...bool) string
FixURL 改写文件网址
func (*Filesystem) FixURLWithParams ¶
FixURLWithParams 替换文件网址为带参数的网址
func (*Filesystem) Get ¶
func (f *Filesystem) Get(dstFile string) (io.ReadCloser, error)
Get 获取文件读取接口
func (*Filesystem) PublicURL ¶
func (f *Filesystem) PublicURL(dstFile string) string
PublicURL 文件物理路径转为文件网址
func (*Filesystem) Put ¶
func (f *Filesystem) Put(dstFile string, src io.Reader, size int64) (savePath string, viewURL string, err error)
Put 上传文件
func (*Filesystem) SendFile ¶
func (f *Filesystem) SendFile(ctx echo.Context, file string) error
SendFile 下载文件
func (*Filesystem) URLToFile ¶
func (f *Filesystem) URLToFile(publicURL string) string
URLToFile 文件网址转为文件物理路径
func (*Filesystem) URLToPath ¶
func (f *Filesystem) URLToPath(publicURL string) string
URLToPath 文件网址转为文件路径
func (*Filesystem) URLWithParams ¶
func (f *Filesystem) URLWithParams(rawURL string, values url.Values) string
URLWithParams 文件网址增加参数
Click to show internal directories.
Click to hide internal directories.