Documentation
¶
Index ¶
- func CopyPaths(os State, v *fst.Paths)
- type State
- type Std
- func (s *Std) EvalSymlinks(path string) (string, error)
- func (s *Std) Exit(code int)
- func (s *Std) Geteuid() int
- func (s *Std) LookPath(file string) (string, error)
- func (s *Std) LookupEnv(key string) (string, bool)
- func (s *Std) LookupGroup(name string) (*user.Group, error)
- func (s *Std) MustExecutable() string
- func (s *Std) Open(name string) (fs.File, error)
- func (s *Std) Paths() fst.Paths
- func (s *Std) Printf(format string, v ...any)
- func (s *Std) Println(v ...any)
- func (s *Std) ReadDir(name string) ([]os.DirEntry, error)
- func (s *Std) Stat(name string) (fs.FileInfo, error)
- func (s *Std) TempDir() string
- func (s *Std) Uid(aid int) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type State ¶
type State interface { // Geteuid provides [os.Geteuid]. Geteuid() int // LookupEnv provides [os.LookupEnv]. LookupEnv(key string) (string, bool) // TempDir provides [os.TempDir]. TempDir() string // LookPath provides [exec.LookPath]. LookPath(file string) (string, error) // MustExecutable provides [proc.MustExecutable]. MustExecutable() string // LookupGroup provides [user.LookupGroup]. LookupGroup(name string) (*user.Group, error) // ReadDir provides [os.ReadDir]. ReadDir(name string) ([]fs.DirEntry, error) // Stat provides [os.Stat]. Stat(name string) (fs.FileInfo, error) // Open provides [os.Open] Open(name string) (fs.File, error) // EvalSymlinks provides [filepath.EvalSymlinks] EvalSymlinks(path string) (string, error) // Exit provides [os.Exit]. Exit(code int) Println(v ...any) Printf(format string, v ...any) // Paths returns a populated [Paths] struct. Paths() fst.Paths // Uid invokes fsu and returns target uid. // Any errors returned by Uid is already wrapped [fmsg.BaseError]. Uid(aid int) (int, error) }
State provides safe interaction with operating system state.
type Std ¶
type Std struct {
// contains filtered or unexported fields
}
Std implements System using the standard library.
func (*Std) MustExecutable ¶
Click to show internal directories.
Click to hide internal directories.