local

package
v2.2.3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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:"-"`
	Type            string
	// contains filtered or unexported fields
}

Filesystem 文件系统存储引擎

func NewFilesystem

func NewFilesystem(ctx context.Context, typ string, baseURLs ...string) *Filesystem

func (*Filesystem) BaseURL

func (f *Filesystem) BaseURL() string

BaseURL 根网址

func (*Filesystem) Close

func (f *Filesystem) Close() error

Close 关闭连接

func (*Filesystem) Delete

func (f *Filesystem) Delete(dstFile string) error

Delete 删除文件

func (*Filesystem) DeleteDir

func (f *Filesystem) DeleteDir(dstDir string) error

DeleteDir 删除文件夹及其内部文件

func (*Filesystem) ErrIsNotExist

func (f *Filesystem) ErrIsNotExist(err error) bool

func (*Filesystem) Exists

func (f *Filesystem) Exists(file string) (bool, error)

Exists 判断文件是否存在

func (*Filesystem) FileDir

func (f *Filesystem) FileDir(subpath string) string

FileDir 物理路径文件夹

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

func (f *Filesystem) FixURLWithParams(content string, values url.Values, embedded ...bool) string

FixURLWithParams 替换文件网址为带参数的网址

func (*Filesystem) Get

func (f *Filesystem) Get(dstFile string) (io.ReadCloser, error)

Get 获取文件读取接口

func (*Filesystem) Move

func (f *Filesystem) Move(src, dst string) error

Move 移动文件

func (*Filesystem) Name

func (f *Filesystem) Name() string

Name 引擎名

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) SetBaseURL

func (f *Filesystem) SetBaseURL(baseURL string)

SetBaseURL 设置根网址

func (*Filesystem) URLDir

func (f *Filesystem) URLDir(subpath string) string

URLDir 网址路径文件夹

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 文件网址增加参数

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL