Documentation ¶
Index ¶
- func Check(err error, msgAndArgs ...string)
- func CheckHandle(err error, msgAndArgs ...string) error
- func CheckHandleMsg(msg string, err error) error
- func ConcatStrings(stringsOrSlices ...interface{}) []string
- func DefaultString(strs ...string) string
- func DistinctStrings(strs []string) []string
- func FindFileInDirOrAncestors(dir string, filename string) (string, error)
- func HashBytesToString(b []byte) string
- func HashToStringViaYaml(i interface{}) (string, error)
- func HomeDir() string
- func Must(err error, msgAndArgs ...string)
- func Retry(attempts int, callback func() error) (err error)
- func RetryAfter(attempts int, callback func() error, d time.Duration) (err error)
- func SortedKeys(i interface{}) []string
- func StringSliceToMap(ss ...string) map[string]string
- func TryCatch(label string, fn func() error) (err error)
- type Logger
- type Prefixer
- type ProgressBar
- type RetriableError
- type Tabler
- type TempFile
- type WithLogFielder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHandle ¶
func CheckHandleMsg ¶
func ConcatStrings ¶
func ConcatStrings(stringsOrSlices ...interface{}) []string
func DefaultString ¶
DefaultString returns the first string that is not empty
func DistinctStrings ¶
func HashBytesToString ¶
func HashToStringViaYaml ¶
func SortedKeys ¶
func SortedKeys(i interface{}) []string
func StringSliceToMap ¶
StringSliceToMap converts []string{"a","A", "b", "B"} to map[string]string{"a":"A", "b":"B"}
Types ¶
type Prefixer ¶
type Prefixer struct {
// contains filtered or unexported fields
}
Prefixer implements io.Reader and io.WriterTo. It reads data from the underlying reader and prepends every line with a given string.
type ProgressBar ¶
ProgressBar is a thread-safe, simple progress bar
func NewProgressBar ¶
func NewProgressBar(max int) *ProgressBar
NewProgressBar returns a new ProgressBar with the specified maximum
func (*ProgressBar) Add ¶
func (p *ProgressBar) Add(num int, label string) error
Add with increase the current count on the progress bar
func (*ProgressBar) Clear ¶
func (p *ProgressBar) Clear() error
Clear attempts to erase the progress bar.
func (*ProgressBar) Reset ¶
func (p *ProgressBar) Reset()
Reset will reset the clock that is used to calculate current time and the time left.
func (*ProgressBar) SetMax ¶
func (p *ProgressBar) SetMax(num int)
SetMax sets the total number of the progress bar
func (*ProgressBar) SetSize ¶
func (p *ProgressBar) SetSize(size int)
SetSize sets the size of the progress bar.
func (*ProgressBar) SetTheme ¶
func (p *ProgressBar) SetTheme(theme []string)
func (*ProgressBar) SetWriter ¶
func (p *ProgressBar) SetWriter(w io.Writer)
SetWriter will specify a different writer than os.Stdout
type RetriableError ¶
type RetriableError struct {
Err error
}
func (RetriableError) Error ¶
func (r RetriableError) Error() string
type TempFile ¶
type WithLogFielder ¶
type WithLogFielder interface { Logger WithLogField(name string, value interface{}) WithLogFielder }