Documentation ¶
Index ¶
- func EnvMapToDotEnv(m map[string]string) []string
- func EnvMapToEnvv(m map[string]string) []string
- func Exists(filePath string) (bool, error)
- func FindProcess(pid int) *os.Process
- func FormatDotEnvEntry(name, value string) string
- func FormatEnvvEntry(name, value string) string
- func IsSymlink(filePath string) (bool, error)
- func IsValidPid(pid int) bool
- func IsWritable(filePath string) (bool, error)
- func KillGroup(pgid int) error
- func KillProcess(pid int) error
- func ParseEnvvEntry(entry string) (name, value string)
- func ShutdownGroup(ctx context.Context, gpid int) error
- func ShutdownProcess(ctx context.Context, pid int) error
- func SignalGroup(pgid int, sig os.Signal) error
- func SignalProcess(pid int, sig os.Signal) error
- func TerminateGroup(pgid int) error
- func TerminateGroupWithTimeout(pgid int, timeout time.Duration) error
- func TerminateProcess(pid int) error
- func TerminateProcessWithTimeout(pid int, timeout time.Duration) error
- func WaitProcess(pid int) (*os.ProcessState, error)
- func WriteFileSync(name string, data []byte, perm fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvMapToDotEnv ¶
Convert an environment map to a slice of strings suitable for a .env file. Entries are of the form name=value and sorted. Values are shell-quoted.
func EnvMapToEnvv ¶
Convert an environment map to a slice of strings suitable for exec. Entries are of the form name=value and sorted. No escaping is performed.
func FindProcess ¶
func FormatDotEnvEntry ¶
Creates entries of the form name=value. Values are shell-quoted.
func FormatEnvvEntry ¶
Returns an entry in the form name=value. No escaping is performed.
func IsValidPid ¶
func IsWritable ¶
func KillProcess ¶
func ParseEnvvEntry ¶
Parses an name=value entry where the value is returned literally.
func ShutdownProcess ¶
Terminates pid, then if context is cancelled, kills pid.
func TerminateGroup ¶
func TerminateProcess ¶
func WaitProcess ¶
func WaitProcess(pid int) (*os.ProcessState, error)
func WriteFileSync ¶
TODO: This might not actually help anything. See <https://twitter.com/tomfaulhaber/status/1447376910531448832>.
Types ¶
This section is empty.