Documentation ¶
Overview ¶
Package os provides a mockable wrapper for os.
Index ¶
- type Impl
- func (*Impl) Chdir(dir string) error
- func (*Impl) Chmod(name string, mode fs.FileMode) error
- func (*Impl) Chown(name string, uid int, gid int) error
- func (*Impl) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (*Impl) Clearenv()
- func (*Impl) Create(name string) (*os.File, error)
- func (*Impl) CreateTemp(dir string, pattern string) (*os.File, error)
- func (*Impl) DirFS(dir string) fs.FS
- func (*Impl) Environ() []string
- func (*Impl) Executable() (string, error)
- func (*Impl) Exit(code int)
- func (*Impl) Expand(s string, mapping func(string) string) string
- func (*Impl) ExpandEnv(s string) string
- func (*Impl) FindProcess(pid int) (*os.Process, error)
- func (*Impl) Getegid() int
- func (*Impl) Getenv(key string) string
- func (*Impl) Geteuid() int
- func (*Impl) Getgid() int
- func (*Impl) Getgroups() ([]int, error)
- func (*Impl) Getpagesize() int
- func (*Impl) Getpid() int
- func (*Impl) Getppid() int
- func (*Impl) Getuid() int
- func (*Impl) Getwd() (dir string, err error)
- func (*Impl) Hostname() (name string, err error)
- func (*Impl) IsExist(err error) bool
- func (*Impl) IsNotExist(err error) bool
- func (*Impl) IsPathSeparator(c uint8) bool
- func (*Impl) IsPermission(err error) bool
- func (*Impl) IsTimeout(err error) bool
- func (*Impl) Lchown(name string, uid int, gid int) error
- func (*Impl) Link(oldname string, newname string) error
- func (*Impl) LookupEnv(key string) (string, bool)
- func (*Impl) Lstat(name string) (fs.FileInfo, error)
- func (*Impl) Mkdir(name string, perm fs.FileMode) error
- func (*Impl) MkdirAll(path string, perm fs.FileMode) error
- func (*Impl) MkdirTemp(dir string, pattern string) (string, error)
- func (*Impl) NewFile(fd uintptr, name string) *os.File
- func (*Impl) NewSyscallError(syscall string, err error) error
- func (*Impl) Open(name string) (*os.File, error)
- func (*Impl) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
- func (*Impl) Pipe() (r *os.File, w *os.File, err error)
- func (*Impl) ReadDir(name string) ([]fs.DirEntry, error)
- func (*Impl) ReadFile(name string) ([]byte, error)
- func (*Impl) Readlink(name string) (string, error)
- func (*Impl) Remove(name string) error
- func (*Impl) RemoveAll(path string) error
- func (*Impl) Rename(oldpath string, newpath string) error
- func (*Impl) SameFile(fi1 fs.FileInfo, fi2 fs.FileInfo) bool
- func (*Impl) Setenv(key string, value string) error
- func (*Impl) StartProcess(name string, argv []string, attr *os.ProcAttr) (*os.Process, error)
- func (*Impl) Stat(name string) (fs.FileInfo, error)
- func (*Impl) Symlink(oldname string, newname string) error
- func (*Impl) TempDir() string
- func (*Impl) Truncate(name string, size int64) error
- func (*Impl) Unsetenv(key string) error
- func (*Impl) UserCacheDir() (string, error)
- func (*Impl) UserConfigDir() (string, error)
- func (*Impl) UserHomeDir() (string, error)
- func (*Impl) WriteFile(name string, data []byte, perm fs.FileMode) error
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct{}
func (*Impl) Executable ¶
func (*Impl) Getpagesize ¶
func (*Impl) IsNotExist ¶
func (*Impl) IsPathSeparator ¶
func (*Impl) IsPermission ¶
func (*Impl) StartProcess ¶
func (*Impl) UserCacheDir ¶
func (*Impl) UserConfigDir ¶
func (*Impl) UserHomeDir ¶
type Interface ¶
type Interface interface { Chdir(dir string) error Chmod(name string, mode fs.FileMode) error Chown(name string, uid int, gid int) error Chtimes(name string, atime time.Time, mtime time.Time) error Clearenv() Create(name string) (*os.File, error) CreateTemp(dir string, pattern string) (*os.File, error) DirFS(dir string) fs.FS Environ() []string Executable() (string, error) Exit(code int) Expand(s string, mapping func(string) string) string ExpandEnv(s string) string FindProcess(pid int) (*os.Process, error) Getegid() int Getenv(key string) string Geteuid() int Getgid() int Getgroups() ([]int, error) Getpagesize() int Getpid() int Getppid() int Getuid() int Getwd() (dir string, err error) Hostname() (name string, err error) IsExist(err error) bool IsNotExist(err error) bool IsPathSeparator(c uint8) bool IsPermission(err error) bool IsTimeout(err error) bool Lchown(name string, uid int, gid int) error Link(oldname string, newname string) error LookupEnv(key string) (string, bool) Lstat(name string) (fs.FileInfo, error) Mkdir(name string, perm fs.FileMode) error MkdirAll(path string, perm fs.FileMode) error MkdirTemp(dir string, pattern string) (string, error) NewFile(fd uintptr, name string) *os.File NewSyscallError(syscall string, err error) error Open(name string) (*os.File, error) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error) Pipe() (r *os.File, w *os.File, err error) ReadDir(name string) ([]fs.DirEntry, error) ReadFile(name string) ([]byte, error) Readlink(name string) (string, error) Remove(name string) error RemoveAll(path string) error Rename(oldpath string, newpath string) error SameFile(fi1 fs.FileInfo, fi2 fs.FileInfo) bool Setenv(key string, value string) error StartProcess(name string, argv []string, attr *os.ProcAttr) (*os.Process, error) Stat(name string) (fs.FileInfo, error) Symlink(oldname string, newname string) error TempDir() string Truncate(name string, size int64) error Unsetenv(key string) error UserCacheDir() (string, error) UserConfigDir() (string, error) UserHomeDir() (string, error) WriteFile(name string, data []byte, perm fs.FileMode) error }
Directories ¶
Path | Synopsis |
---|---|
Package exec provides a mockable wrapper for os/exec.
|
Package exec provides a mockable wrapper for os/exec. |
Package signal provides a mockable wrapper for os/signal.
|
Package signal provides a mockable wrapper for os/signal. |
Package user provides a mockable wrapper for os/user.
|
Package user provides a mockable wrapper for os/user. |
Click to show internal directories.
Click to hide internal directories.