os

package
v0.0.0-...-fab57c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package os provides a mockable wrapper for os.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) Chdir

func (*Impl) Chdir(dir string) error

func (*Impl) Chmod

func (*Impl) Chmod(name string, mode fs.FileMode) error

func (*Impl) Chown

func (*Impl) Chown(name string, uid int, gid int) error

func (*Impl) Chtimes

func (*Impl) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*Impl) Clearenv

func (*Impl) Clearenv()

func (*Impl) Create

func (*Impl) Create(name string) (*os.File, error)

func (*Impl) CreateTemp

func (*Impl) CreateTemp(dir string, pattern string) (*os.File, error)

func (*Impl) DirFS

func (*Impl) DirFS(dir string) fs.FS

func (*Impl) Environ

func (*Impl) Environ() []string

func (*Impl) Executable

func (*Impl) Executable() (string, error)

func (*Impl) Exit

func (*Impl) Exit(code int)

func (*Impl) Expand

func (*Impl) Expand(s string, mapping func(string) string) string

func (*Impl) ExpandEnv

func (*Impl) ExpandEnv(s string) string

func (*Impl) FindProcess

func (*Impl) FindProcess(pid int) (*os.Process, error)

func (*Impl) Getegid

func (*Impl) Getegid() int

func (*Impl) Getenv

func (*Impl) Getenv(key string) string

func (*Impl) Geteuid

func (*Impl) Geteuid() int

func (*Impl) Getgid

func (*Impl) Getgid() int

func (*Impl) Getgroups

func (*Impl) Getgroups() ([]int, error)

func (*Impl) Getpagesize

func (*Impl) Getpagesize() int

func (*Impl) Getpid

func (*Impl) Getpid() int

func (*Impl) Getppid

func (*Impl) Getppid() int

func (*Impl) Getuid

func (*Impl) Getuid() int

func (*Impl) Getwd

func (*Impl) Getwd() (dir string, err error)

func (*Impl) Hostname

func (*Impl) Hostname() (name string, err error)

func (*Impl) IsExist

func (*Impl) IsExist(err error) bool

func (*Impl) IsNotExist

func (*Impl) IsNotExist(err error) bool

func (*Impl) IsPathSeparator

func (*Impl) IsPathSeparator(c uint8) bool

func (*Impl) IsPermission

func (*Impl) IsPermission(err error) bool

func (*Impl) IsTimeout

func (*Impl) IsTimeout(err error) bool

func (*Impl) Lchown

func (*Impl) Lchown(name string, uid int, gid int) error
func (*Impl) Link(oldname string, newname string) error

func (*Impl) LookupEnv

func (*Impl) LookupEnv(key string) (string, bool)

func (*Impl) Lstat

func (*Impl) Lstat(name string) (fs.FileInfo, error)

func (*Impl) Mkdir

func (*Impl) Mkdir(name string, perm fs.FileMode) error

func (*Impl) MkdirAll

func (*Impl) MkdirAll(path string, perm fs.FileMode) error

func (*Impl) MkdirTemp

func (*Impl) MkdirTemp(dir string, pattern string) (string, error)

func (*Impl) NewFile

func (*Impl) NewFile(fd uintptr, name string) *os.File

func (*Impl) NewSyscallError

func (*Impl) NewSyscallError(syscall string, err error) error

func (*Impl) Open

func (*Impl) Open(name string) (*os.File, error)

func (*Impl) OpenFile

func (*Impl) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)

func (*Impl) Pipe

func (*Impl) Pipe() (r *os.File, w *os.File, err error)

func (*Impl) ReadDir

func (*Impl) ReadDir(name string) ([]fs.DirEntry, error)

func (*Impl) ReadFile

func (*Impl) ReadFile(name string) ([]byte, error)
func (*Impl) Readlink(name string) (string, error)

func (*Impl) Remove

func (*Impl) Remove(name string) error

func (*Impl) RemoveAll

func (*Impl) RemoveAll(path string) error

func (*Impl) Rename

func (*Impl) Rename(oldpath string, newpath string) error

func (*Impl) SameFile

func (*Impl) SameFile(fi1 fs.FileInfo, fi2 fs.FileInfo) bool

func (*Impl) Setenv

func (*Impl) Setenv(key string, value string) error

func (*Impl) StartProcess

func (*Impl) StartProcess(name string, argv []string, attr *os.ProcAttr) (*os.Process, error)

func (*Impl) Stat

func (*Impl) Stat(name string) (fs.FileInfo, error)
func (*Impl) Symlink(oldname string, newname string) error

func (*Impl) TempDir

func (*Impl) TempDir() string

func (*Impl) Truncate

func (*Impl) Truncate(name string, size int64) error

func (*Impl) Unsetenv

func (*Impl) Unsetenv(key string) error

func (*Impl) UserCacheDir

func (*Impl) UserCacheDir() (string, error)

func (*Impl) UserConfigDir

func (*Impl) UserConfigDir() (string, error)

func (*Impl) UserHomeDir

func (*Impl) UserHomeDir() (string, error)

func (*Impl) WriteFile

func (*Impl) WriteFile(name string, data []byte, perm fs.FileMode) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL