progress

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Done added in v0.0.33

func Done() tea.Msg

func Subscribe

func Subscribe(obs Observable, handler HandlerFunc) rx.Subscription

func SubscribeMessage added in v0.0.33

func SubscribeMessage(obs Observable, handler MessageFunc) rx.Subscription

func SubscribeTotal added in v0.0.33

func SubscribeTotal(obs Observable, handler TotalFunc) rx.Subscription

Types

type DoneMsg added in v0.0.33

type DoneMsg struct{}

type Event

type Event struct {
	MessageEvent
	TotalEvent
}

func (Event) ProgressMsg added in v0.0.33

func (e Event) ProgressMsg() ProgressMsg

type File added in v0.0.33

type File interface {
	afero.File
	Reader
}

func Open added in v0.0.33

func Open(fs afero.Fs, name string) (File, error)

type Func added in v0.0.33

type Func interface {
	~func(*Event, error) | ~func(float64, error) | ~func(string, error)
}

type HandlerFunc added in v0.0.33

type HandlerFunc func(*Event, error)

func ChannelHandler added in v0.0.33

func ChannelHandler(stream chan<- *Event, errs chan<- error) HandlerFunc

func Lift added in v0.0.33

func Lift[F Func](fn F) HandlerFunc

func TeaHandler added in v0.0.33

func TeaHandler(prog *tea.Program) HandlerFunc

func (HandlerFunc) OnComplete added in v0.0.33

func (fn HandlerFunc) OnComplete()

OnComplete implements rx.Observer.

func (HandlerFunc) OnError added in v0.0.33

func (fn HandlerFunc) OnError(err error)

OnError implements rx.Observer.

func (HandlerFunc) OnNext added in v0.0.33

func (fn HandlerFunc) OnNext(e Event)

OnNext implements rx.Observer.

func (HandlerFunc) SubscribeTo added in v0.0.33

func (fn HandlerFunc) SubscribeTo(obs Observable) rx.Subscription

type MessageEvent added in v0.0.33

type MessageEvent struct {
	Message string
}

type MessageFunc added in v0.0.33

type MessageFunc func(string, error)

func (MessageFunc) Handler added in v0.0.33

func (fn MessageFunc) Handler() HandlerFunc

func (MessageFunc) OnComplete added in v0.0.33

func (fn MessageFunc) OnComplete()

OnComplete implements rx.Observer.

func (MessageFunc) OnError added in v0.0.33

func (fn MessageFunc) OnError(err error)

OnError implements rx.Observer.

func (MessageFunc) OnNext added in v0.0.33

func (fn MessageFunc) OnNext(e Event)

OnNext implements rx.Observer.

func (MessageFunc) SubscribeTo added in v0.0.33

func (fn MessageFunc) SubscribeTo(obs Observable) rx.Subscription

type MessageObservable added in v0.0.33

type MessageObservable interface {
	rx.Observable[string]
}

type Model added in v0.0.33

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

func NewModel added in v0.0.33

func NewModel() Model

func (Model) Init added in v0.0.33

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update added in v0.0.33

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update implements tea.Model.

func (Model) View added in v0.0.33

func (m Model) View() string

View implements tea.Model.

type Observable

type Observable interface {
	rx.Observable[Event]
}

type ProgressMsg added in v0.0.33

type ProgressMsg float64

func ToMsg added in v0.0.33

func ToMsg(e *Event) ProgressMsg

type Reader

type Reader interface {
	Observable
	io.Reader
}

func NewReader

func NewReader(r io.Reader, total int) Reader

type State added in v0.0.33

type State interface {
	Advance(int) TotalEvent
}

type Subject added in v0.0.33

type Subject interface {
	rx.Subject[Event]
	State
}

func NewSubject added in v0.0.33

func NewSubject(total int) Subject

type TotalEvent added in v0.0.33

type TotalEvent struct {
	Current int
	Total   int
}

func (TotalEvent) Percent added in v0.0.33

func (e TotalEvent) Percent() float64

type TotalFunc added in v0.0.33

type TotalFunc func(float64, error)

func (TotalFunc) Handler added in v0.0.33

func (fn TotalFunc) Handler() HandlerFunc

func (TotalFunc) OnComplete added in v0.0.33

func (TotalFunc) OnComplete()

OnComplete implements rx.Observer.

func (TotalFunc) OnError added in v0.0.33

func (fn TotalFunc) OnError(err error)

OnError implements rx.Observer.

func (TotalFunc) OnNext added in v0.0.33

func (r TotalFunc) OnNext(e Event)

OnNext implements rx.Observer.

func (TotalFunc) SubscribeTo added in v0.0.33

func (fn TotalFunc) SubscribeTo(obs Observable) rx.Subscription

type TotalObservable added in v0.0.33

type TotalObservable interface {
	rx.Observable[float64]
}

type Writer

type Writer interface {
	Observable
	io.Writer
}

func NewWriter

func NewWriter(w io.Writer, total int) Writer

Jump to

Keyboard shortcuts

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