os

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCommandFromString

func BuildCommandFromString(input string) (string, []string)

BuildCommandFromString parses a string containing a command and multiple arguments and returns a valid tuple to pass to exec.Command

func CopyFile

func CopyFile(src string, dst string) error

CopyFile copies a source file to a destination.

func Getopt

func Getopt(name, dfault string) string

Getopt return the value of and environment variable or a default

func Hostname

func Hostname() (name string, err error)

Hostname returns the host name reported by the kernel.

func Random

func Random(size int) (string, error)

Random return a random string

func RunCommand

func RunCommand(command string, args []string) error

RunCommand run a command and return.

func RunProcessAsDaemon

func RunProcessAsDaemon(signalChan chan os.Signal, command string, args []string)

RunProcessAsDaemon start a child process that will run indefinitely

func RunScript

func RunScript(script string, params map[string]string, loader func(string) ([]byte, error)) error

RunScript run a shell script using go-basher and if it returns an error send a signal to terminate the execution

Types

This section is empty.

Jump to

Keyboard shortcuts

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