Documentation
¶
Index ¶
- func MustPath(p string) (r path.Relative)
- func MustWD() (r path.Relative)
- func Normalize(p path.Local) path.Relative
- func ParsePath(p string) (r path.Relative, err error)
- func ParseWD() (r path.Relative, err error)
- type FS
- func (fsys *FS) Abs(p path.Relative) path.Absolute
- func (fsys FS) Delete(p path.Relative, recursive bool) (err error)
- func (fsys FS) Drive(p path.Relative) (l path.Local, err error)
- func (fsys FS) Exists(p path.Relative) bool
- func (fsys FS) FreeSpace(r path.Relative) int64
- func (fsys FS) GetMode(p path.Relative) (m fs.FileMode, err error)
- func (fsys FS) Glob(pattern string) (matches []path.Relative, err error)
- func (fsys FS) ModTime(p path.Relative) (t time.Time, err error)
- func (fsys FS) Move(src, trgtDir path.Relative) (err error)
- func (fsys FS) ReadSeeker(r path.Relative) (io.ReadSeekCloser, error)
- func (fsys FS) Reader(p path.Relative) (io.ReadCloser, error)
- func (fsys FS) Rename(p path.Relative, name string) (err error)
- func (fsys FS) SetMode(p path.Relative, m fs.FileMode) (err error)
- func (fsys FS) Size(file path.Relative) int64
- func (fsys FS) Write(p path.Relative, rd io.ReadCloser, inbetween bool) (err error)
- func (fsys FS) WriteWithMode(p path.Relative, data io.ReadCloser, m fs.FileMode, recursive bool) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustPath ¶ added in v0.17.0
MustPath is like ParsePath, only that it panics, if the given path is not valid
func Normalize ¶ added in v0.17.0
Normalize transforms a local path into a path relative to the rootfs, so that it is usable within rootfs it returns a normal relative path on unix and on windows a relative path to an imaginary root that would reside above the drive letters, so that the returned relative path would start with the lowercase drive letter, followed by a slash and the normal rest of the path e.g.
C:\Windows\Temp => c/Windows/Temp D:\files => d/files /hi/ho => hi/ho
It is supposed to be used with the rootfs in order to have a crossplattform root fs.
func ParsePath ¶ added in v0.17.0
ParsePath parses an existing local path and returns a normalized path that is relative to rootfs the path might be absolute or relative (than it is relative to the current working directory) the given path must not end in a slash. if p must not be an empty string, or .
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func (FS) GetMode ¶ added in v0.17.0
should not return mode for a mountpoint (error (not implemented)), should return error (not implemented), if there is no fallback
func (FS) ReadSeeker ¶ added in v0.17.0
func (fsys FS) ReadSeeker(r path.Relative) (io.ReadSeekCloser, error)