Documentation
¶
Index ¶
- func CheckForFileData(fs FileSystem, url, mount string) (data []byte, mime, path string, ok bool)
- func EnumerateCheckPaths(src string) (checkPaths []string)
- func FileExists(path string) (exists bool)
- func FindFileMime(path string) (mime string, err error)
- func FindFileShasum(path string) (shasum string, err error)
- func ListAllDirs(path string) (dirs []string, err error)
- func ListAllFiles(path string) (files []string, err error)
- func ListDirs(path string) (dirs []string, err error)
- func ListFiles(path string) (files []string, err error)
- func RegisterFileSystem(mount string, f FileSystem)
- func RegisteredFileSystems() (registered map[string][]FileSystem)
- type File
- type FileSystem
- type MountPoint
- type WrapFileSystem
- func (w WrapFileSystem) Exists(path string) (exists bool)
- func (w WrapFileSystem) FileCreated(path string) (created int64, err error)
- func (w WrapFileSystem) LastModified(path string) (updated int64, err error)
- func (w WrapFileSystem) ListAllDirs(path string) (paths []string, err error)
- func (w WrapFileSystem) ListAllFiles(path string) (paths []string, err error)
- func (w WrapFileSystem) ListDirs(path string) (paths []string, err error)
- func (w WrapFileSystem) ListFiles(path string) (paths []string, err error)
- func (w WrapFileSystem) MimeType(path string) (mime string, err error)
- func (w WrapFileSystem) Name() (name string)
- func (w WrapFileSystem) Open(path string) (file fs.File, err error)
- func (w WrapFileSystem) ReadDir(path string) (entries []fs.DirEntry, err error)
- func (w WrapFileSystem) ReadFile(path string) (data []byte, err error)
- func (w WrapFileSystem) Shasum(path string) (shasum string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForFileData ¶
func CheckForFileData(fs FileSystem, url, mount string) (data []byte, mime, path string, ok bool)
func EnumerateCheckPaths ¶
func FileExists ¶
func FindFileMime ¶
func FindFileShasum ¶
func ListAllDirs ¶
func ListAllFiles ¶
func RegisterFileSystem ¶
func RegisterFileSystem(mount string, f FileSystem)
func RegisteredFileSystems ¶
func RegisteredFileSystems() (registered map[string][]FileSystem)
Types ¶
type FileSystem ¶
type FileSystem interface {
Name() (name string)
Open(path string) (fh fs.File, err error)
ListDirs(path string) (paths []string, err error)
ListFiles(path string) (paths []string, err error)
ListAllDirs(path string) (paths []string, err error)
ListAllFiles(path string) (paths []string, err error)
ReadDir(path string) (paths []fs.DirEntry, err error)
ReadFile(path string) (content []byte, err error)
MimeType(path string) (mime string, err error)
Shasum(path string) (shasum string, err error)
FileCreated(path string) (created int64, err error)
LastModified(path string) (dateTime int64, err error)
Exists(path string) (exists bool)
}
func Wrap ¶
func Wrap(path string, fs FileSystem) (out FileSystem, err error)
type MountPoint ¶
type MountPoint struct {
Path string
Mount string
FS FileSystem
}
func (MountPoint) String ¶
func (mp MountPoint) String() (info string)
type WrapFileSystem ¶
type WrapFileSystem struct {
// contains filtered or unexported fields
}
func (WrapFileSystem) Exists ¶
func (w WrapFileSystem) Exists(path string) (exists bool)
func (WrapFileSystem) FileCreated ¶
func (w WrapFileSystem) FileCreated(path string) (created int64, err error)
func (WrapFileSystem) LastModified ¶
func (w WrapFileSystem) LastModified(path string) (updated int64, err error)
func (WrapFileSystem) ListAllDirs ¶
func (w WrapFileSystem) ListAllDirs(path string) (paths []string, err error)
func (WrapFileSystem) ListAllFiles ¶
func (w WrapFileSystem) ListAllFiles(path string) (paths []string, err error)
func (WrapFileSystem) ListDirs ¶
func (w WrapFileSystem) ListDirs(path string) (paths []string, err error)
func (WrapFileSystem) ListFiles ¶
func (w WrapFileSystem) ListFiles(path string) (paths []string, err error)
func (WrapFileSystem) MimeType ¶
func (w WrapFileSystem) MimeType(path string) (mime string, err error)
func (WrapFileSystem) Name ¶
func (w WrapFileSystem) Name() (name string)
func (WrapFileSystem) ReadDir ¶
func (w WrapFileSystem) ReadDir(path string) (entries []fs.DirEntry, err error)
Click to show internal directories.
Click to hide internal directories.