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) GetHeight() int
- func (m *Model) GetListenCmd() Cmd
- func (m *Model) GetProcessesSlice() []Process
- func (m *Model) GetWidth() int
- func (m *Model) HasRunningProcesses() bool
- func (m *Model) ListDown()
- func (m *Model) ListUp()
- func (m *Model) ListenForChannelUpdates()
- func (m *Model) Render(processBarFocused bool) string
- func (m *Model) SendAddProcessMsg(currentFile string, operation OperationType, 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 OperationType
- 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) GetProcessesSlice ¶ added in v1.5.0
Copy of the current processes for read only purpose
func (*Model) HasRunningProcesses ¶
func (*Model) ListUp ¶
func (m *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 OperationType ¶ added in v1.5.0
type OperationType int
const ( OpCopy OperationType = iota OpCut OpDelete OpCompress OpExtract )
func (OperationType) GetIcon ¶ added in v1.5.0
func (op OperationType) GetIcon() string
GetIcon returns the appropriate icon for the operation type
func (OperationType) GetPastVerb ¶ added in v1.5.0
func (op OperationType) GetPastVerb() string
GetPastVerb returns the past tense verb for the operation
func (OperationType) GetVerb ¶ added in v1.5.0
func (op OperationType) GetVerb() string
GetVerb returns the present tense verb for the operation
type Process ¶
type Process struct {
ID string
CurrentFile string
// TODO : We always want ErrorMsg to be set when State is
// moved to Cancelled or Failed. To ensure it, we need to only allow state
// change via helper functions and ask for the errorMsg
ErrorMsg string
Operation OperationType
Progress progress.Model
State ProcessState
Total int
Done int
DoneTime time.Time
}
Model for an individual process Note : Its size is ~ 800 bytes
func NewProcess ¶
func NewProcess(id string, currentFile string, operation OperationType, total int) Process
func (*Process) GetDisplayName ¶ added in v1.5.0
GetDisplayName returns the appropriate display name for the process
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