Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EnvInfoer ¶ added in v2.21.0
type EnvInfoer interface {
// User returns the current user.
User() (*user.User, error)
// Environ returns the environment variables of the current process.
Environ() []string
// HomeDir returns the home directory of the current user.
HomeDir() (string, error)
// Shell returns the shell of the given user.
Shell(username string) (string, error)
// ModifyCommand modifies the command and arguments before execution based on
// the environment. This is useful for executing a command inside a container.
// In the default case, the command and arguments are returned unchanged.
ModifyCommand(name string, args ...string) (string, []string)
}
EnvInfoer encapsulates external information about the environment.
type SystemEnvInfo ¶ added in v2.21.0
type SystemEnvInfo struct{}
SystemEnvInfo encapsulates the information about the environment just using the default Go implementations.
func (SystemEnvInfo) Environ ¶ added in v2.21.0
func (SystemEnvInfo) Environ() []string
func (SystemEnvInfo) HomeDir ¶ added in v2.21.0
func (SystemEnvInfo) HomeDir() (string, error)
func (SystemEnvInfo) ModifyCommand ¶ added in v2.21.0
func (SystemEnvInfo) ModifyCommand(name string, args ...string) (string, []string)
Click to show internal directories.
Click to hide internal directories.