Documentation
¶
Index ¶
- type BaseMsg
- type Cmd
- type Model
- func (m *Model) AddOrUpdateProcess(p Process)
- func (m *Model) AddProcess(p Process) error
- func (m *Model) GetByID(id string) (Process, bool)
- func (m *Model) GetListenCmd() Cmd
- func (m *Model) HasRunningProcesses() bool
- func (m *Model) ListDown(footerHeight int)
- func (m *Model) ListUp(footerHeight int)
- func (m *Model) ListenForChannelUpdates()
- func (m *Model) Render(processBarFocussed bool) string
- func (m *Model) SendAddProcessMsg(name string, total int, blockingSend bool) (Process, error)
- func (m *Model) SendStopListeningMsgBlocking()
- func (m *Model) SendUpdateProcessMsg(p Process, blockingSend bool) error
- func (m *Model) SetDimensions(width int, height int)
- func (m *Model) TrySendingUpdateProcessMsg(p Process)
- func (m *Model) UpdateExistingProcess(p Process) error
- type NoProcessFoundError
- type Process
- type ProcessAlreadyExistsError
- type ProcessChannelFullError
- type ProcessState
- type UpdateMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseMsg ¶
type BaseMsg struct {
// contains filtered or unexported fields
}
TODO: Can we remove this duplication with model_msg ?
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model for process bar internal
func NewModelWithOptions ¶
Note: We should considering our internal models, they should be returning pointer object, and implement tea.Model
func (*Model) AddOrUpdateProcess ¶
func (*Model) AddProcess ¶
func (*Model) GetListenCmd ¶
An IO Operation, that will wait forever on msgChannel
func (*Model) HasRunningProcesses ¶
func (*Model) ListUp ¶
Control processbar panel list up There is a shadowing happening here, but it will be removed Once we make footerHeight part of model struct
func (*Model) ListenForChannelUpdates ¶
func (m *Model) ListenForChannelUpdates()
Only used in tests, to have processbar used in a standalone way without model
func (*Model) SendAddProcessMsg ¶
func (*Model) SendStopListeningMsgBlocking ¶
func (m *Model) SendStopListeningMsgBlocking()
func (*Model) SendUpdateProcessMsg ¶
func (*Model) SetDimensions ¶
func (*Model) TrySendingUpdateProcessMsg ¶
Non Blocking and can fail
func (*Model) UpdateExistingProcess ¶
type NoProcessFoundError ¶
type NoProcessFoundError struct {
// contains filtered or unexported fields
}
func (*NoProcessFoundError) Error ¶
func (p *NoProcessFoundError) Error() string
type Process ¶
type Process struct {
ID string
Name string
Progress progress.Model
State ProcessState
Total int
Done int
DoneTime time.Time
}
Model for an individual process Note : Its size is ~ 800 bytes
type ProcessAlreadyExistsError ¶
type ProcessAlreadyExistsError struct {
// contains filtered or unexported fields
}
func (*ProcessAlreadyExistsError) Error ¶
func (p *ProcessAlreadyExistsError) Error() string
type ProcessChannelFullError ¶
type ProcessChannelFullError struct {
}
func (*ProcessChannelFullError) Error ¶
func (p *ProcessChannelFullError) Error() string
type ProcessState ¶
type ProcessState int
const ( InOperation ProcessState = iota Successful Cancelled Failed )
func (ProcessState) Icon ¶
func (p ProcessState) Icon() string
TODO : Should we store in a global map for efficiency ? At least need to prerender Yes, this is a Render() call, which is expensive