Documentation ¶
Index ¶
- func ConfigureLog(filename string, toStdout bool, toFile bool)
- func ContainsString(haystack []string, needle string) bool
- func FileExists(filename string) bool
- func InterfaceIsZero(targetInterface interface{}) bool
- func LoadFileIntoSlice(filename string) ([]string, error)
- func LoadXML(filename string) mxj.Map
- func RunSSHCommand(runSSHConfiguration RunSSHConfiguration, command string) string
- func SanitiseHTTPProxyURL(url string) string
- func SanitisePath(path string) string
- func ShellOut(command string, args []string) (string, error)
- func UnsanitisePath(path string) string
- func ValueHasField(value reflect.Value, fieldName string) bool
- func ValueHasMethod(value reflect.Value, methodName string) bool
- func WriteSliceToFile(filename string, contents []string)
- func WriteToFile(filename string, content []byte)
- func WriteXML(filename string, xmlMap mxj.Map)
- type RunSSHConfiguration
- type TeeLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureLog ¶
ConfigureLog configures the logging.
func ContainsString ¶
ContainsString returns true if a string slice contains the target string and false otherwise.
func FileExists ¶
FileExists returns whether or not a file exists.
func InterfaceIsZero ¶
func InterfaceIsZero(targetInterface interface{}) bool
InterfaceIsZero determines whether or not an interface is its type's zero value.
func LoadFileIntoSlice ¶
LoadFileIntoSlice loads a file into a string slice.
func RunSSHCommand ¶
func RunSSHCommand(runSSHConfiguration RunSSHConfiguration, command string) string
RunSSHCommand runs an ssh command.
func SanitiseHTTPProxyURL ¶
SanitiseHTTPProxyURL strips the protocol (assumed to actually be http) and replaces it with http://, unless the string length without protocol is 0 in which case the empty string is returned.
func UnsanitisePath ¶
UnsanitisePath translates $HOME into ~.
func ValueHasField ¶
ValueHasField returns whether a value has a given field.
func ValueHasMethod ¶
ValueHasMethod returns whether a value has a given method.
func WriteSliceToFile ¶
WriteSliceToFile writes a string slice to a file.
func WriteToFile ¶
WriteToFile writes a byte array to a file safely.
Types ¶
type RunSSHConfiguration ¶
RunSSHConfiguration defines the configuration necessary to run an ssh command.