Documentation
¶
Index ¶
- Variables
- type Path
- func (p *Path) Afero() afero.Afero
- func (p *Path) Chmod(mode os.FileMode) error
- func (p *Path) Chtimes(atime time.Time, mtime time.Time) error
- func (p *Path) Equals(other *Path) (bool, error)
- func (p *Path) Exists() (bool, error)
- func (p *Path) GetLatest() (*Path, error)
- func (p *Path) Glob(pattern string) ([]*Path, error)
- func (p *Path) IsAbsolute() bool
- func (p *Path) IsDir() (bool, error)
- func (p *Path) IsFile() (bool, error)
- func (p *Path) IsSymlink() (bool, error)
- func (p *Path) Join(elems ...string) *Path
- func (p *Path) Mkdir(perm os.FileMode) error
- func (p *Path) MkdirAll(perm os.FileMode) error
- func (p *Path) Name() string
- func (p *Path) Parent() *Path
- func (p *Path) Path() string
- func (p *Path) ReadDir() ([]os.FileInfo, error)
- func (p *Path) ReadFile() ([]byte, error)
- func (p *Path) RelativeTo(other *Path) (*Path, error)
- func (p *Path) Remove() error
- func (p *Path) RemoveAll() error
- func (p *Path) Rename(target string) (*Path, error)
- func (p *Path) RenamePath(target *Path) (*Path, error)
- func (p *Path) Resolve() (*Path, error)
- func (p *Path) Stat() (os.FileInfo, error)
- func (p *Path) Symlink(target *Path) error
- func (p *Path) WriteFile(data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrDoesNotImplement = errors.Errorf("doesn't implement required interface")
)
Functions ¶
This section is empty.
Types ¶
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is an object that represents a path
func NewPathAfero ¶
NewPathAfero returns a Path object with the given Afero object
func (*Path) Equals ¶
Equals returns whether or not the path pointed to by other has the same resolved filepath as self.
func (*Path) GetLatest ¶
GetLatest returns the file or directory that has the most recent mtime. Only works if this path is a directory and it exists. If the directory is empty, the returned Path object will be nil.
func (*Path) IsAbsolute ¶
IsAbsolute returns whether or not the path is an absolute path. This is determined by checking if the path starts with a slash.
func (*Path) Rename ¶
Rename this path to the given target and return the corresponding Path object.
func (*Path) RenamePath ¶
RenamePath is the same as Rename except target is a Path object