progress

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartTransfer

func StartTransfer(src io.Reader, dest io.Writer, progress *components.Progress) (int64, error)

StartTransfer trans scr to desc, increase the progress by the way

Types

type Group

type Group struct {
	*components.PrintHelper

	// kill program
	Quit key.Binding
	// contains filtered or unexported fields
}

Group the progress group

func NewGroup

func NewGroup(progressList ...*components.Progress) *Group

NewGroup progressList the size must > 1

func NewGroupWithCount

func NewGroupWithCount(progressCnt int) *Group

func (*Group) AppendRunner

func (g *Group) AppendRunner(f func(progress *components.Progress) func()) *Group

func (*Group) Display

func (g *Group) Display() error

func (*Group) Init

func (g *Group) Init() tea.Cmd

func (*Group) Kill

func (g *Group) Kill()

func (*Group) SetProgram

func (g *Group) SetProgram(program *tea.Program)

func (*Group) Update

func (g *Group) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Group) View

func (g *Group) View() string

func (*Group) WithDoneView

func (g *Group) WithDoneView(f func() string) *Group

WithDoneView when Group is done, will callback this func, will overwrite the progress doneView in the Group.

func (*Group) WithQuitKey

func (g *Group) WithQuitKey(key key.Binding) *Group

WithQuitKey replace `Quit` key, user interrupt, kill program.

type Transfer

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

func (Transfer) Write

func (t Transfer) Write(bytes []byte) (n int, err error)

Jump to

Keyboard shortcuts

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