mirror of
https://git.numenor-labs.us/dsfx.git
synced 2025-04-29 16:20:34 +00:00
31 lines
1015 B
Go
31 lines
1015 B
Go
package system
|
|
|
|
import (
|
|
"git.numenor-labs.us/dsfx/internal/lib/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
|
|
}
|