utils

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReadLimitReached added in v0.14.6

func IsReadLimitReached(bytesLoaded int64, linesLoaded int64, logFilePosition string) bool

IsReadLimitReached checks logs if truncated by apiServer

func MockProgress

func MockProgress() (*Progress, *Bar)

func MountPathClean added in v0.14.3

func MountPathClean(mountPath string) string

MountPathClean cleans the path for mountPath

func NewDynProgressBar added in v0.14.6

func NewDynProgressBar(title string, quiet bool, total int64) (*mpb.Progress, *mpb.Bar)

NewDynProgressBar init a dynamic progress bar,the title will appears at the head of the progress bar

func SplitLog added in v0.14.6

func SplitLog(logContent string, startIndex, endIndex int, overFlag bool) string

Types

type Bar

type Bar struct {
	*mpb.Bar
	// contains filtered or unexported fields
}

func (*Bar) Done

func (b *Bar) Done()

func (*Bar) IncrTotal

func (b *Bar) IncrTotal(n int64)

func (*Bar) SetTotal

func (b *Bar) SetTotal(total int64)

type DoubleSpinner

type DoubleSpinner struct {
	// contains filtered or unexported fields
}

func (*DoubleSpinner) Current

func (s *DoubleSpinner) Current() (int64, int64)

func (*DoubleSpinner) Done

func (s *DoubleSpinner) Done()

func (*DoubleSpinner) IncrInt64

func (s *DoubleSpinner) IncrInt64(size int64)

type LogPage added in v0.14.6

type LogPage struct {
	LogFilePosition string
	LineLimit       int
	SizeLimit       int64
	HasNextPage     bool
	Truncated       bool
}

func (*LogPage) Dividing added in v0.14.6

func (l *LogPage) Dividing(contentLineNum, contentByteLength int) (int, int)

Dividing get startIndex and endIndex of contents, by

func (*LogPage) Paging added in v0.14.6

func (l *LogPage) Paging(content string, logContentLineNum int) string

Paging divided content into pages

func (*LogPage) SlicePaging added in v0.14.6

func (l *LogPage) SlicePaging(content []string) []string

SlicePaging divided slice into pages

type Progress

type Progress struct {
	*mpb.Progress
	Quiet bool
	// contains filtered or unexported fields
}

func NewProgress

func NewProgress(quiet, showSpeed bool) *Progress

func (*Progress) AddByteSpinner

func (p *Progress) AddByteSpinner(name string) *Bar

func (*Progress) AddCountBar

func (p *Progress) AddCountBar(name string, total int64) *Bar

func (*Progress) AddCountSpinner

func (p *Progress) AddCountSpinner(name string) *Bar

func (*Progress) AddDoubleSpinner

func (p *Progress) AddDoubleSpinner(name string) *DoubleSpinner

func (*Progress) Done

func (p *Progress) Done()

Jump to

Keyboard shortcuts

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