dsfx/pkg/system/system.go

31 lines
1009 B
Go
Raw Normal View History

package system
import (
"koti.casa/numenor-labs/dsfx/pkg/disk"
)
type System interface {
// Args returns the command-line arguments passed to the program.
Args() []string
// Arg returns the command-line argument at the specified index.
Arg(int) string
// UserHomeDir returns the user's home directory.
UserHomeDir() (string, error)
// UserConfigDir returns the user's configuration directory.
UserConfigDir() (string, error)
// UserCacheDir returns the user's cache directory.
UserCacheDir() (string, error)
// Stdout returns the standard output file.
Stdout() disk.File
// Stderr returns the standard error file.
Stderr() disk.File
// TempDir returns the directory used for temporary files.
TempDir() string
// Exit terminates the program with the given exit code.
Exit(int)
// GetEnv retrieves the value of the environment variable named by key.
GetEnv(key string) string
// SetEnv sets the value of the environment variable named by key to value.
SetEnv(key, value string) error
}