Documentation ¶
Overview ¶
Package shared contains types and functions shared by different tailfs packages.
Index ¶
- func CleanAndSplit(p string) []string
- func IsRoot(p string) bool
- func Join(parts ...string) string
- type DirFile
- type StaticFileInfo
- func (fi *StaticFileInfo) BirthTime(_ context.Context) (time.Time, error)
- func (fi *StaticFileInfo) IsDir() bool
- func (fi *StaticFileInfo) ModTime() time.Time
- func (fi *StaticFileInfo) Mode() os.FileMode
- func (fi *StaticFileInfo) Name() string
- func (fi *StaticFileInfo) Size() int64
- func (fi *StaticFileInfo) Sys() any
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAndSplit ¶
CleanAndSplit cleans the provided path p and splits it into its constituent parts. This is different from path.Split which just splits a path into prefix and suffix.
Types ¶
type DirFile ¶
type DirFile struct { // Info provides the fs.FileInfo for this directory Info fs.FileInfo // LoadChildren is used to load the fs.FileInfos for this directory's // children. It is called at most once in order to support listing // children. LoadChildren func() ([]fs.FileInfo, error) // contains filtered or unexported fields }
DirFile implements webdav.File for a virtual directory. It mimics the behavior of an os.File that is pointing at a real directory.
func (*DirFile) Close ¶
Close implements interface webdav.File. It does nothing and never returns an error.
func (*DirFile) Read ¶
Read implements interface webdav.File. As this is a directory, it always fails with an fs.PathError.
func (*DirFile) Readdir ¶
Readdir implements interface webdav.File. It lazily loads information about children when it is called.
func (*DirFile) Seek ¶
Seek implements interface webdav.File. As this is a directory, it always fails with an fs.PathError.
type StaticFileInfo ¶
type StaticFileInfo struct { // Named controls Name() Named string // Sized controls Size() Sized int64 // Moded controls Mode() Moded os.FileMode // BirthedTime controls BirthTime() BirthedTime time.Time // BirthedTimeErr stores any error encountered when trying to get BirthTime BirthedTimeErr error // ModdedTime controls ModTime() ModdedTime time.Time // Dir controls IsDir() Dir bool }
StaticFileInfo implements a static fs.FileInfo
func ReadOnlyDirInfo ¶
func ReadOnlyDirInfo(name string, ts time.Time) *StaticFileInfo
ReadOnlyDirInfo returns a static fs.FileInfo for a read-only directory
func RenamedFileInfo ¶
func (*StaticFileInfo) IsDir ¶
func (fi *StaticFileInfo) IsDir() bool
func (*StaticFileInfo) ModTime ¶
func (fi *StaticFileInfo) ModTime() time.Time
func (*StaticFileInfo) Mode ¶
func (fi *StaticFileInfo) Mode() os.FileMode
func (*StaticFileInfo) Name ¶
func (fi *StaticFileInfo) Name() string
func (*StaticFileInfo) Size ¶
func (fi *StaticFileInfo) Size() int64
func (*StaticFileInfo) Sys ¶
func (fi *StaticFileInfo) Sys() any