utils

package
v0.0.0-...-f662469 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCouldNotGetDeviceStat = errors.New("could not get device stat")
)

Functions

func ConcurrentMap

func ConcurrentMap[I, O any](
	input []I,
	callback func(index int, input I, output *O, addDefer func(deferFunc func() error)) error,
) ([]O, [][]func() error, []error)

func CopyFile

func CopyFile(src, dst string, uid int, gid int) (int64, error)

func GetBlockDevicePadding

func GetBlockDevicePadding(resourceSize int64) int64

func IsClosedErr

func IsClosedErr(err error) bool

func ReadLineNoBuffer

func ReadLineNoBuffer(conn io.Reader) (string, error)

func WriteFile

func WriteFile(content []byte, output string, uid int, gid int) (int, error)

Types

type LoopMount

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

func NewLoopMount

func NewLoopMount(file string) *LoopMount

func (*LoopMount) Close

func (l *LoopMount) Close() error

func (*LoopMount) Open

func (l *LoopMount) Open() (string, error)

type ProgressBar

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

func NewProgressBar

func NewProgressBar(
	progress *mpb.Progress,
	label string,
) *ProgressBar

func (*ProgressBar) Clear

func (p *ProgressBar) Clear()

func (*ProgressBar) IncreaseTotal

func (p *ProgressBar) IncreaseTotal(delta int64)

func (*ProgressBar) Pause

func (p *ProgressBar) Pause() func()

func (*ProgressBar) SetRemaining

func (p *ProgressBar) SetRemaining(remaining int64)

func (*ProgressBar) SetTotal

func (p *ProgressBar) SetTotal(total int64)

Jump to

Keyboard shortcuts

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