moreos

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Exe is the runtime.GOOS-specific suffix for executables. Ex. "" unless windows which is ".exe"
	// See https://github.com/golang/go/issues/47567 for formalization
	Exe = exe
	// OSDarwin is a Platform.OS a.k.a. "macOS"
	OSDarwin = "darwin"
	// OSLinux is a Platform.OS
	OSLinux = "linux"
	// OSWindows is a Platform.OS
	OSWindows = "windows"
)

Variables

This section is empty.

Functions

func EnsureProcessDone added in v0.7.0

func EnsureProcessDone(p *os.Process) error

EnsureProcessDone makes sure the process has exited completely.

func Errorf added in v0.7.0

func Errorf(format string, a ...interface{}) error

Errorf is like fmt.Errorf except it translates paths with ReplacePathSeparator when Windows. This is needed because by default '\' escapes.

func Fprintf added in v0.7.0

func Fprintf(w io.Writer, format string, a ...interface{})

Fprintf is like fmt.Fprintf, but handles EOL according runtime.GOOS. See Sprintf for notes.

func Interrupt

func Interrupt(p *os.Process) error

Interrupt attempts to interrupt the process. It doesn't necessarily kill it.

func IsExecutable

func IsExecutable(f os.FileInfo) bool

IsExecutable returns true if the input can be run as an exec.Cmd

func ProcessGroupAttr

func ProcessGroupAttr() *syscall.SysProcAttr

ProcessGroupAttr sets attributes that ensure exec.Cmd doesn't propagate signals from func-e by default. This is used to ensure shutdown hooks can apply

func ReplacePathSeparator added in v0.7.0

func ReplacePathSeparator(input string) string

ReplacePathSeparator returns the input unless it is Windows. When Windows, all '/' characters replace with '\'.

func Sprintf added in v0.7.0

func Sprintf(format string, a ...interface{}) string

Sprintf is like Fprintf is like fmt.Sprintf, except any '\n' in the format are converted according to runtime.GOOS. This allows us to be consistent with Envoy, which handles \r\n on Windows. See also https://github.com/golang/go/issues/28822

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL