Documentation
¶
Index ¶
- type File
- type FileSystem
- type Local
- func (fs *Local) DeleteFile(path string) error
- func (fs *Local) ListFiles() ([]*proto.FileSpec, error)
- func (fs *Local) Open(name string) (fspkg.File, error)
- func (fs *Local) OpenFile(path string) (File, error)
- func (fs *Local) Resolve(path string) string
- func (fs *Local) WriteFile(spec *proto.FileSpec, r io.Reader) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem interface { ListFiles() ([]*proto.FileSpec, error) DeleteFile(path string) error OpenFile(path string) (File, error) WriteFile(spec *proto.FileSpec, r io.Reader) error Resolve(path string) string }
文件子系统接口。 所谓“子”,就是针对某篇文章。 TODO 应该用标准的接口。
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
针对某篇文章的文件系统实现类。 目录结构:配置的文章附件根目录/文章编号/附件路径。 TODO 改成全局一个实例统一管理所有文章的文件。
func (*Local) DeleteFile ¶
Click to show internal directories.
Click to hide internal directories.