Documentation
¶
Index ¶
- type Filepath
- type Ioutil
- type OS
- type StandardFilepath
- func (sf *StandardFilepath) Abs(path string) (string, error)
- func (sf *StandardFilepath) Base(path string) string
- func (sf *StandardFilepath) Clean(path string) string
- func (sf *StandardFilepath) Dir(path string) string
- func (sf *StandardFilepath) Ext(path string) string
- func (sf *StandardFilepath) FromSlash(path string) string
- func (sf *StandardFilepath) Join(elem ...string) string
- func (sf *StandardFilepath) Split(path string) (dir, file string)
- func (sf *StandardFilepath) Walk(root string, walkFn filepath.WalkFunc) error
- type StandardIoutil
- type StandardOS
- func (sos *StandardOS) Chmod(name string, mode os.FileMode) error
- func (sos *StandardOS) Chown(name string, uid, gid int) error
- func (sos *StandardOS) Create(name string) (*os.File, error)
- func (sos *StandardOS) Executable() (string, error)
- func (sos *StandardOS) Getpid() int
- func (sos *StandardOS) Getwd() (string, error)
- func (sos *StandardOS) IsNotExist(err error) bool
- func (sos *StandardOS) Mkdir(name string, perm os.FileMode) error
- func (sos *StandardOS) MkdirAll(path string, perm os.FileMode) error
- func (sos *StandardOS) Open(name string) (*os.File, error)
- func (sos *StandardOS) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func (sos *StandardOS) Remove(name string) error
- func (sos *StandardOS) RemoveAll(path string) error
- func (sos *StandardOS) Rename(oldpath, newpath string) error
- func (sos *StandardOS) Stat(name string) (os.FileInfo, error)
- type StandardUser
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filepath ¶
type Filepath interface {
Abs(path string) (string, error)
Base(path string) string
Ext(path string) string
Dir(path string) string
Walk(root string, walkFn filepath.WalkFunc) error
FromSlash(path string) string
Join(elem ...string) string
Clean(path string) string
Split(path string) (dir, file string)
}
Filepath ...
type Ioutil ¶
type Ioutil interface {
ReadFile(filename string) ([]byte, error)
WriteFile(filename string, data []byte, perm os.FileMode) error
}
Ioutil ...
type OS ¶
type OS interface {
Filepath
User
Ioutil
Create(name string) (*os.File, error)
Getwd() (string, error)
Mkdir(name string, perm os.FileMode) error
MkdirAll(path string, perm os.FileMode) error
Remove(name string) error
RemoveAll(path string) error
Rename(oldpath, newpath string) error
Stat(name string) (os.FileInfo, error)
Chown(name string, uid, gid int) error
Chmod(name string, mode os.FileMode) error
IsNotExist(err error) bool
Open(name string) (*os.File, error)
OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
Executable() (string, error)
Getpid() int
}
OS ...
type StandardFilepath ¶
type StandardFilepath struct {
AbsF func(path string) (string, error)
BaseF func(path string) string
ExtF func(path string) string
DirF func(path string) string
WalkF func(root string, walkFn filepath.WalkFunc) error
FromSlashF func(path string) string
JoinF func(elem ...string) string
CleanF func(path string) string
SplitF func(path string) (dir, file string)
}
StandardFilepath ...
func (*StandardFilepath) FromSlash ¶
func (sf *StandardFilepath) FromSlash(path string) string
FromSlash ...
func (*StandardFilepath) Split ¶
func (sf *StandardFilepath) Split(path string) (dir, file string)
Split ...
type StandardIoutil ¶
type StandardIoutil struct {
ReadFileF func(filename string) ([]byte, error)
WriteFileF func(filename string, data []byte, perm os.FileMode) error
}
StandardIoutil ...
type StandardOS ¶
type StandardOS struct {
*StandardFilepath
*StandardUser
*StandardIoutil
CreateF func(name string) (*os.File, error)
GetwdF func() (string, error)
MkdirF func(name string, perm os.FileMode) error
MkdirAllF func(path string, perm os.FileMode) error
RemoveF func(name string) error
RemoveAllF func(path string) error
RenameF func(oldpath, newpath string) error
StatF func(name string) (os.FileInfo, error)
ChownF func(name string, uid, gid int) error
ChmodF func(name string, mode os.FileMode) error
IsNotExistF func(err error) bool
OpenF func(name string) (*os.File, error)
OpenFileF func(name string, flag int, perm os.FileMode) (*os.File, error)
ExecutableF func() (string, error)
GetpidF func() int
}
StandardOS ...
func (*StandardOS) Chmod ¶
func (sos *StandardOS) Chmod(name string, mode os.FileMode) error
Chmod ...
func (*StandardOS) Mkdir ¶
func (sos *StandardOS) Mkdir(name string, perm os.FileMode) error
Mkdir ...
func (*StandardOS) MkdirAll ¶
func (sos *StandardOS) MkdirAll(path string, perm os.FileMode) error
MkdirAll ...
type StandardUser ¶
type StandardUser struct {
AddGroupF func(name string) error
AddUserF func(usr string, group string) error
LookupGroupF func(name string) (*user.Group, error)
LookupF func(username string) (*user.User, error)
}
StandardUser ...
func (*StandardUser) AddUser ¶
func (su *StandardUser) AddUser(usr string, group string) error
AddUser ...
func (*StandardUser) Lookup ¶
func (su *StandardUser) Lookup(username string) (*user.User, error)
Lookup ...
func (*StandardUser) LookupGroup ¶
func (su *StandardUser) LookupGroup(name string) (*user.Group, error)
LookupGroup ...
Click to show internal directories.
Click to hide internal directories.