util

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = func() *logrus.Logger {
	l := logrus.New()
	l.SetLevel(logrus.WarnLevel)
	l.SetOutput(os.Stdout)
	l.SetFormatter(&logrus.JSONFormatter{
		PrettyPrint: true,
	})
	return l
}()

Functions

func CheckColors added in v1.0.5

func CheckColors(fn func(string, ...any) string, format string, a ...any) string

func FatalIfError

func FatalIfError(err error)

func GetHostnameFromPath added in v1.1.3

func GetHostnameFromPath(path string) string

func GetIdealConcurrency

func GetIdealConcurrency() uint

func NewInterrupt added in v1.1.3

func NewInterrupt() *interrupt

func PathExists

func PathExists(path string) bool

func PathSanitize added in v1.2.3

func PathSanitize(paths ...*string)

func TablePrinter

func TablePrinter() *tablePrinter

func UseColors

func UseColors() bool

Types

type Progressbar added in v1.1.0

type Progressbar struct {
	*progressbar.ProgressBar
	// contains filtered or unexported fields
}

func NewProgressbar added in v1.1.0

func NewProgressbar(m int, options ...ProgressbarOption) *Progressbar

func (*Progressbar) Add added in v1.1.0

func (p *Progressbar) Add(i int) *Progressbar

func (*Progressbar) ChangeMax added in v1.1.0

func (p *Progressbar) ChangeMax(max int) *Progressbar

func (*Progressbar) Clear added in v1.1.0

func (p *Progressbar) Clear() *Progressbar

func (*Progressbar) Describe added in v1.1.0

func (p *Progressbar) Describe(format string, a ...any) *Progressbar

func (*Progressbar) Inc added in v1.1.0

func (p *Progressbar) Inc() *Progressbar

func (*Progressbar) Print added in v1.1.0

func (p *Progressbar) Print()

func (*Progressbar) SetMessageOnCompletion added in v1.1.0

func (p *Progressbar) SetMessageOnCompletion(msg string) *Progressbar

type ProgressbarOption added in v1.1.0

type ProgressbarOption = progressbar.Option

type RegexList

type RegexList []string

func (RegexList) Match

func (l RegexList) Match(target string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL