Documentation ¶
Index ¶
- Variables
- func BashExec(cmd string) error
- func CloseFile(fp *os.File)
- func CreateTempFile(dir, pattern string) (string, error)
- func EnsureDir(dirname string) error
- func FmtTime(t *time.Time) string
- func FormatTime(t *time.Time) string
- func GetTermWindowSize() (int, int, error)
- func IsTermEnabled(fd int) bool
- func LogStdError(format string, v ...interface{})
- func LogStderr(err error, format string, v ...interface{})
- func LogStderrExit(err error, format string, v ...interface{})
- func LogStdout(format string, v ...interface{})
- func MyPathTo(filename string) string
- func OpenFile(filename string, flag int) (*os.File, error)
- func OpenLogger(verbose bool) (io.Closer, error)
- func OptsBool(opts docopt.Opts, key string) bool
- func OptsContains(opts docopt.Opts, key string) bool
- func OptsInt(opts docopt.Opts, key string) int
- func OptsSeconds(opts docopt.Opts, key string) time.Duration
- func OptsStr(opts docopt.Opts, key string) string
- func OptsStrSlice(opts docopt.Opts, key string) []string
- func RandAlphaNumericStr(n int) string
- func RemoveNewLines(s string, r string) string
- func StatExists(fileOrDirname string) (bool, error)
- func TimeTrack(start time.Time, name string)
- func TrimLength(s string, maxLen int) string
- type BufferedWriteCloser
- type BytesWriter
- type LinenumWriter
- type MarshalledDuration
- type Runner
- type RunnerContext
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Log = zlog.Logger
)
View Source
var Trace = func(label string, msg string, vals ...interface{}) {}
Functions ¶
func CreateTempFile ¶
func FormatTime ¶
func GetTermWindowSize ¶
GetTermWindowSize returns the terminal window size in rows, columns
func IsTermEnabled ¶
IsTermEnabled returns true if the given file descriptor is a terminal.
func LogStdError ¶
func LogStdError(format string, v ...interface{})
func LogStderrExit ¶
func OpenLogger ¶
OpenLogger opens the default rolling file logger and sets the verbosity of the logger
func OptsContains ¶
func OptsSeconds ¶
func OptsStrSlice ¶
func RandAlphaNumericStr ¶
func RemoveNewLines ¶
func StatExists ¶
func TrimLength ¶
Types ¶
type BufferedWriteCloser ¶
func NewBufferedWriteCloser ¶
func NewBufferedWriteCloser(writer io.Writer) *BufferedWriteCloser
This WriteCloser is guaranteed to never let a Write block. However, it's at the expense of more memory usage (especially if the writer passed in is slow).
func (*BufferedWriteCloser) Close ¶
func (bw *BufferedWriteCloser) Close() error
type BytesWriter ¶
type BytesWriter struct {
// contains filtered or unexported fields
}
func NewBytesWriter ¶
func NewBytesWriter() *BytesWriter
func (*BytesWriter) GetBytes ¶
func (b *BytesWriter) GetBytes() []byte
func (*BytesWriter) GetString ¶
func (b *BytesWriter) GetString() string
type LinenumWriter ¶
type LinenumWriter struct {
// contains filtered or unexported fields
}
func NewLinenumWriter ¶
func NewLinenumWriter(start, cursorLine, prefixWidth int, cursor string) *LinenumWriter
func (*LinenumWriter) Close ¶
func (lw *LinenumWriter) Close() error
func (*LinenumWriter) String ¶
func (lw *LinenumWriter) String() string
type MarshalledDuration ¶
MarshalledDuration allows the duration to de-serialized from Yaml ToDo: json and Marshall Yaml
func (MarshalledDuration) GetDuration ¶
func (t MarshalledDuration) GetDuration() time.Duration
func (MarshalledDuration) MarshalYAML ¶
func (t MarshalledDuration) MarshalYAML() (interface{}, error)
func (*MarshalledDuration) UnmarshalYAML ¶
func (t *MarshalledDuration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshalls Yaml to duration See: https://pkg.go.dev/gopkg.in/yaml.v2#Unmarshaler
Source Files ¶
Click to show internal directories.
Click to hide internal directories.