Documentation
¶
Index ¶
- Variables
- func ConvertTimestamp(timestamp int64) *time.Time
- func DisableLogging()
- func EnableLogging()
- func Exec(cmd string, shell string, interactive bool, pseudoTTY bool, stdin io.Reader, ...) *exec.ExitError
- func GetStatusCode(err *exec.ExitError) int
- func Open(filename string) (handler *os.File)
- func RemoveWithLogging(fileName string) error
- func SplitCommandToChunks(cmd string) (string, []string)
- type Regexp
- type SynchronizedWriter
Constants ¶
This section is empty.
Variables ¶
var Logger = logrus.New()
Logger is a global logging instance has to be used everywhere
Functions ¶
func ConvertTimestamp ¶
ConvertTimestamp converts timestamp to time structure
func Exec ¶
func Exec(cmd string, shell string, interactive bool, pseudoTTY bool, stdin io.Reader, stdout io.Writer, stderr io.Writer) *exec.ExitError
Exec runs a command with connected streams and according to the TTY usage.
func GetStatusCode ¶
GetStatusCode returns an exit code from exec.ExitError
func RemoveWithLogging ¶
RemoveWithLogging does the same as os.Remove does but logs.
func SplitCommandToChunks ¶
SplitCommandToChunks splits a command to the command name and its arguments.
Types ¶
type Regexp ¶
type Regexp struct {
// contains filtered or unexported fields
}
Regexp is just a wrapper to play with different regular expression libraries to get the best one.
func CreateRegexp ¶
CreateRegexp creates a regexp with MustCompile (or equialent) method.
type SynchronizedWriter ¶
type SynchronizedWriter struct {
// contains filtered or unexported fields
}
SynchronizedWriter provides WriteCloser interface with mutexed operations.
func NewSynchronizedWriter ¶
func NewSynchronizedWriter(writer io.WriteCloser) (sw *SynchronizedWriter)
NewSynchronizedWriter makes writer synchronized.
func (*SynchronizedWriter) Close ¶
func (sw *SynchronizedWriter) Close() (err error)
Close closes content to the writer mutually exclusive.