Documentation ¶
Index ¶
- type FileRO
- type FileRW
- type MockPath
- func (p *MockPath) Absolute() (Path, error)
- func (p *MockPath) Chmod(mode os.FileMode) error
- func (p *MockPath) Cwd() (Path, error)
- func (p *MockPath) Exists() bool
- func (p *MockPath) IsAbs() bool
- func (p *MockPath) IsDir() bool
- func (p *MockPath) IsFile() bool
- func (p *MockPath) JoinPath(elem ...string) Path
- func (p *MockPath) MkDir(mode os.FileMode, parents bool) error
- func (p *MockPath) Open() (FileRO, error)
- func (p *MockPath) OpenRW(flag int, mode os.FileMode) (FileRW, error)
- func (p *MockPath) Parent() (Path, error)
- func (p *MockPath) ReadBytes() ([]byte, error)
- func (p *MockPath) ReadText() (string, error)
- func (p *MockPath) Rename(target Path) error
- func (p *MockPath) RmDir() error
- func (p *MockPath) String() string
- func (p *MockPath) Touch() error
- func (p *MockPath) Unlink() error
- func (p *MockPath) WriteBytes(data []byte) error
- func (p *MockPath) WriteText(text string) error
- type OsPath
- func (p *OsPath) Absolute() (Path, error)
- func (p *OsPath) Chmod(mode os.FileMode) error
- func (p *OsPath) Cwd() (Path, error)
- func (p *OsPath) Exists() bool
- func (p *OsPath) IsAbs() bool
- func (p *OsPath) IsDir() bool
- func (p *OsPath) IsFile() bool
- func (p *OsPath) JoinPath(elem ...string) Path
- func (p *OsPath) MkDir(mode os.FileMode, parents bool) (err error)
- func (p *OsPath) Open() (FileRO, error)
- func (p *OsPath) OpenRW(flag int, mode os.FileMode) (FileRW, error)
- func (p *OsPath) Parent() (Path, error)
- func (p *OsPath) ReadBytes() ([]byte, error)
- func (p *OsPath) ReadText() (string, error)
- func (p *OsPath) Rename(target Path) error
- func (p *OsPath) RmDir() error
- func (p *OsPath) String() string
- func (p *OsPath) Touch() error
- func (p *OsPath) Unlink() error
- func (p *OsPath) WriteBytes(data []byte) error
- func (p *OsPath) WriteText(text string) error
- type Path
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPath ¶
func (*MockPath) WriteBytes ¶
type OsPath ¶
type OsPath struct {
Path string
}
OsPath
func (*OsPath) JoinPath ¶
JoinPath Returns a new path, Combine current path with one or several arguments
func (*OsPath) Touch ¶
Touch Create creates the named file with mode 0666 (before umask), regardless of whether it exists.
func (*OsPath) WriteBytes ¶
WriteBytes writes a byte slice to the file.
type Path ¶
type Path interface { // Path operations Absolute() (Path, error) Cwd() (Path, error) Parent() (Path, error) JoinPath(elem ...string) Path String() string // File and directory operations Touch() error Unlink() error RmDir() error MkDir(mode os.FileMode, parents bool) error Open() (FileRO, error) OpenRW(flag int, mode os.FileMode) (FileRW, error) Chmod(mode os.FileMode) error Rename(target Path) error Exists() bool // Path testing IsDir() bool IsFile() bool IsAbs() bool // File operations ReadBytes() ([]byte, error) ReadText() (string, error) WriteBytes(data []byte) error WriteText(text string) error }
Click to show internal directories.
Click to hide internal directories.