Documentation ¶
Overview ¶
Package osutil provides operating system-specific path information, and other utility functions.
Index ¶
- func CPUUsage() time.Duration
- func CacheDir() string
- func CamliBlobRoot() string
- func CamliConfigDir() string
- func CamliVarDir() string
- func DefaultTLSCert() string
- func DefaultTLSKey() string
- func DieOnParentDeath()
- func DirExists(dir string) bool
- func FindCamliInclude(configFile string) (absPath string, err error)
- func GoPackagePath(pkg string) (path string, err error)
- func HomeDir() string
- func IdentitySecretRing() string
- func MemUsage() int64
- func OpenURL(url string) error
- func RestartProcess() error
- func UserClientConfigPath() string
- func UserServerConfigPath() string
- func Username() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CPUUsage ¶
CPUUsage returns how much cumulative user CPU time the process has used. On unsupported operating systems, it returns zero.
func CamliBlobRoot ¶
func CamliBlobRoot() string
func CamliConfigDir ¶
func CamliConfigDir() string
func CamliVarDir ¶
func CamliVarDir() string
func DefaultTLSCert ¶
func DefaultTLSCert() string
DefaultTLSCert returns the path to the default TLS certificate file that is used (creating if necessary) when TLS is specified without the cert file.
func DefaultTLSKey ¶
func DefaultTLSKey() string
DefaultTLSKey returns the path to the default TLS key file that is used (creating if necessary) when TLS is specified without the key file.
func DieOnParentDeath ¶
func DieOnParentDeath()
DieOnParentDeath starts a goroutine that regularly checks that the current process can find its parent, and calls os.Exit(0) as soon as it cannot.
func FindCamliInclude ¶
Find the correct absolute path corresponding to a relative path, searching the following sequence of directories: 1. Working Directory 2. CAMLI_CONFIG_DIR (deprecated, will complain if this is on env) 3. (windows only) APPDATA/camli 4. All directories in CAMLI_INCLUDE_PATH (standard PATH form for OS)
func GoPackagePath ¶
GoPackagePath returns the path to the provided Go package's source directory. pkg may be a path prefix without any *.go files. The error is os.ErrNotExist if GOPATH is unset or the directory doesn't exist in any GOPATH component.
func HomeDir ¶
func HomeDir() string
HomeDir returns the path to the user's home directory. It returns the empty string if the value isn't known.
func IdentitySecretRing ¶
func IdentitySecretRing() string
IdentitySecretRing returns the path to the default GPG secret keyring. It is overriden by the CAMLI_SECRET_RING environment variable.
func MemUsage ¶
func MemUsage() int64
MemUsage returns the number of bytes used by the process. On unsupported operating systems, it returns zero.
func RestartProcess ¶
func RestartProcess() error
restartProcess returns an error if things couldn't be restarted. On success, this function never returns because the process becomes the new process.
func UserClientConfigPath ¶
func UserClientConfigPath() string
func UserServerConfigPath ¶
func UserServerConfigPath() string
Types ¶
This section is empty.