Documentation
¶
Index ¶
- func ArgsToCmd(args []string) *exec.Cmd
- func ExecuteAndWait(cmd *exec.Cmd) (int, error)
- func GetIP(specList []string) (string, error)
- func IpFromInterfaces(raw json.RawMessage) (string, error)
- func NewLogWriter(fields log.Fields, level log.Level) io.WriteCloser
- func ParseCommandArgs(raw json.RawMessage) (*exec.Cmd, error)
- func ParseDuration(duration interface{}) (time.Duration, error)
- func ParseInterfaces(raw json.RawMessage) ([]string, error)
- func Run(cmd *exec.Cmd) (int, error)
- func RunWithFields(cmd *exec.Cmd, fields log.Fields) (int, error)
- func StrToCmd(command string) *exec.Cmd
- type ByInterfaceThenIP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteAndWait ¶
ExecuteAndWait runs the given command and blocks until completed
func IpFromInterfaces ¶
func IpFromInterfaces(raw json.RawMessage) (string, error)
func NewLogWriter ¶
NewLogWriter pipes stdout/err logs to logrus
func ParseCommandArgs ¶
func ParseCommandArgs(raw json.RawMessage) (*exec.Cmd, error)
func ParseDuration ¶
ParseDuration parses the given duration with multiple type support int (defaults to seconds) string with units string without units (default to seconds)
func ParseInterfaces ¶
func ParseInterfaces(raw json.RawMessage) ([]string, error)
func Run ¶
Run executes the given command and blocks until completed Returns the exit code and error message (if any). Logs output streams to the log driver instead of stdout/stderr - stderr creates DEBUG level entries - stdout creates INFO level entries
func RunWithFields ¶
RunWithFields executes the given command and blocks until completed Returns the exit code and error message (if any). Logs output streams to the log driver instead of stdout/stderr - stderr creates DEBUG level entries - stdout creates INFO level entries Adds the given fields to the log entries
Types ¶
type ByInterfaceThenIP ¶
type ByInterfaceThenIP []interfaceIP
ByInterfaceThenIP implements the Sort with the following properties: 1. Sort interfaces alphabetically 2. Sort IPs by bytes (normalized to 16 byte form)
func (ByInterfaceThenIP) Len ¶
func (se ByInterfaceThenIP) Len() int
func (ByInterfaceThenIP) Less ¶
func (se ByInterfaceThenIP) Less(i, j int) bool
func (ByInterfaceThenIP) Swap ¶
func (se ByInterfaceThenIP) Swap(i, j int)