-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodels.go
More file actions
53 lines (43 loc) · 768 Bytes
/
models.go
File metadata and controls
53 lines (43 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package taskin
import (
"github.com/charmbracelet/bubbles/progress"
"github.com/charmbracelet/bubbles/spinner"
)
type TerminateWithError struct {
Error error
}
type TaskState int
const (
NotStarted TaskState = iota
Running
Completed
Failed
)
type Task struct {
Title string
Task func(*Task) error
ShowProgress TaskProgress
Bar progress.Model
Config Config
Tasks Tasks
HideView bool
}
type TaskProgress struct {
Current int
Total int
}
type Tasks []Task
type Runner struct {
Task Task
State TaskState
Spinner *spinner.Model
Config Config
Children Runners
}
type Runners []Runner
type Model struct {
Runners Runners
HideView bool
Shutdown bool
ShutdownError error
}