os

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFSNotFound           = errors.New("filesystem not found")
	ErrCrossingFSBoundaries = errors.New("crossing filesystem boundaries")
)

Functions

This section is empty.

Types

type ExitHandler

type ExitHandler func(int)

type OS

type OS struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *OS

func (*OS) Args

func (o *OS) Args() []string

func (*OS) Chdir

func (o *OS) Chdir(dir string) error

func (*OS) Create

func (o *OS) Create(name string) (risoros.File, error)

func (*OS) CurrentUser

func (o *OS) CurrentUser() (risoros.User, error)

func (*OS) Environ

func (o *OS) Environ() []string

func (*OS) Exit

func (o *OS) Exit(code int)

func (*OS) Getenv

func (o *OS) Getenv(key string) string

func (*OS) Getpid

func (o *OS) Getpid() int

func (*OS) Getuid

func (o *OS) Getuid() int

func (*OS) Getwd

func (o *OS) Getwd() (dir string, err error)

func (*OS) Hostname

func (o *OS) Hostname() (string, error)

func (*OS) LookupEnv

func (o *OS) LookupEnv(key string) (string, bool)

func (*OS) LookupGid

func (o *OS) LookupGid(gid string) (risoros.Group, error)

func (*OS) LookupGroup

func (o *OS) LookupGroup(name string) (risoros.Group, error)

func (*OS) LookupUid

func (o *OS) LookupUid(uid string) (risoros.User, error)

func (*OS) LookupUser

func (o *OS) LookupUser(name string) (risoros.User, error)

func (*OS) Mkdir

func (o *OS) Mkdir(name string, perm os.FileMode) error

func (*OS) MkdirAll

func (o *OS) MkdirAll(path string, perm os.FileMode) error

func (*OS) MkdirTemp

func (o *OS) MkdirTemp(dir, pattern string) (string, error)

func (*OS) Open

func (o *OS) Open(name string) (risoros.File, error)

func (*OS) OpenFile

func (o *OS) OpenFile(name string, flag int, perm os.FileMode) (risoros.File, error)

func (*OS) PathListSeparator

func (o *OS) PathListSeparator() rune

func (*OS) PathSeparator

func (o *OS) PathSeparator() rune

func (*OS) ReadDir

func (o *OS) ReadDir(name string) ([]risoros.DirEntry, error)

func (*OS) ReadFile

func (o *OS) ReadFile(name string) ([]byte, error)

func (*OS) Remove

func (o *OS) Remove(name string) error

func (*OS) RemoveAll

func (o *OS) RemoveAll(path string) error

func (*OS) Rename

func (o *OS) Rename(oldpath, newpath string) error

func (*OS) Setenv

func (o *OS) Setenv(key, value string) error

func (*OS) Stat

func (o *OS) Stat(name string) (os.FileInfo, error)

func (*OS) Stdin

func (o *OS) Stdin() risoros.File

func (*OS) Stdout

func (o *OS) Stdout() risoros.File
func (o *OS) Symlink(oldname, newname string) error

func (*OS) TempDir

func (o *OS) TempDir() string

func (*OS) Unsetenv

func (o *OS) Unsetenv(key string) error

func (*OS) UserCacheDir

func (o *OS) UserCacheDir() (string, error)

func (*OS) UserConfigDir

func (o *OS) UserConfigDir() (string, error)

func (*OS) UserHomeDir

func (o *OS) UserHomeDir() (string, error)

func (*OS) WalkDir

func (o *OS) WalkDir(root string, fn risoros.WalkDirFunc) error

func (*OS) WriteFile

func (o *OS) WriteFile(name string, content []byte, perm os.FileMode) error

type Option

type Option func(*OS)

func WithArgs

func WithArgs(args []string) Option

func WithEnvVar

func WithEnvVar(name, value string) Option

func WithExitHandler

func WithExitHandler(handler ExitHandler) Option

func WithFilesystems

func WithFilesystems(fss map[string]risoros.FS) Option

func WithStdin

func WithStdin(file risoros.File) Option

func WithStdout

func WithStdout(file risoros.File) Option

func WithWorkDir

func WithWorkDir(dir string) Option

Jump to

Keyboard shortcuts

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