Documentation ¶
Index ¶
- type Linker
- type Path
- func (p Path) Basename() string
- func (p Path) Empty() (bool, error)
- func (p Path) Exists() (bool, error)
- func (p Path) Join(names ...string) Path
- func (p Path) MkdirAll(perm os.FileMode) error
- func (p Path) Open() (*os.File, error)
- func (p Path) Parent() Path
- func (p Path) Parents() []Path
- func (p Path) ReadDir() ([]fs.DirEntry, error)
- func (p Path) Readlink() (Path, error)
- func (p Path) Remove() error
- func (p Path) RemoveAll() error
- func (p Path) String() string
- func (p Path) Symlink(target Path) error
- func (p Path) Walk(f filepath.WalkFunc) error
- func (p Path) WriteFile(data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Linker ¶
type Linker interface { // CreateLink creates a symlink to the path target at path linkName. It // will also create any missing directories if the underlying filesystem // supports it. The target may be an absolute path. CreateLink(target, linkName string) error // ReadLink fetches path that the link located at name points to. ReadLink(name string) (string, error) // RemoveLink removes the link at the specified path. Any parent // directories that are left empty must be removed by the implementation. RemoveLink(name string) error // Sub returns a Linker rooted at the subdirectory dir inside of the // current Linker's root. If dir is ".", the linker remains unchanged. Sub(dir string) (Linker, error) Root() string }
Linker is an interface for creating symlinks inside of a filesystem. It implements a similar interface to FS in io/fs. The Linker has a root path that all other paths are relative to and implementors of this interface must not support absolute paths unless it is specifically indicated that they are allowed.
Click to show internal directories.
Click to hide internal directories.