-
-
Notifications
You must be signed in to change notification settings - Fork 302
/
action.go
105 lines (76 loc) · 2.36 KB
/
action.go
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package mg
import (
"margo.sh/mg/actions"
)
var (
ActionCreators = (&actions.Registry{}).
Register("QueryCompletions", QueryCompletions{}).
Register("QueryCmdCompletions", QueryCmdCompletions{}).
Register("QueryIssues", QueryIssues{}).
Register("Restart", Restart{}).
Register("Shutdown", Shutdown{}).
Register("ViewActivated", ViewActivated{}).
Register("ViewFmt", ViewFmt{}).
Register("DisplayIssues", DisplayIssues{}).
Register("ViewLoaded", ViewLoaded{}).
Register("ViewModified", ViewModified{}).
Register("ViewPosChanged", ViewPosChanged{}).
Register("ViewPreSave", ViewPreSave{}).
Register("ViewSaved", ViewSaved{}).
Register("QueryUserCmds", QueryUserCmds{}).
Register("QueryTestCmds", QueryTestCmds{}).
Register("RunCmd", RunCmd{}).
Register("QueryTooltips", QueryTooltips{})
)
// initAction is dispatched to indicate the start of IPC communication.
// It's the first action that is dispatched.
type initAction struct{ ActionType }
type ActionType = actions.ActionType
type Action = actions.Action
type DisplayIssues struct{ ActionType }
func (di DisplayIssues) ClientAction() actions.ClientData {
return actions.ClientData{Name: "DisplayIssues", Data: di}
}
type Activate struct {
ActionType
Path string
Name string
Row int
Col int
}
func (a Activate) ClientAction() actions.ClientData {
return actions.ClientData{Name: "Activate", Data: a}
}
var Render Action = nil
type QueryCompletions struct{ ActionType }
type QueryCmdCompletions struct {
ActionType
Pos int
Src string
Name string
Args []string
}
type QueryIssues struct{ ActionType }
// Restart is the action dispatched to initiate a graceful restart of the agent
type Restart struct{ ActionType }
func (r Restart) ClientAction() actions.ClientData {
return actions.ClientData{Name: "Restart"}
}
// Shutdown is the action dispatched to initiate a graceful shutdown of the agent
type Shutdown struct{ ActionType }
func (s Shutdown) ClientAction() actions.ClientData {
return actions.ClientData{Name: "Shutdown"}
}
type QueryTooltips struct {
ActionType
Row int
Col int
}
type ViewActivated struct{ ActionType }
type ViewModified struct{ ActionType }
type ViewPosChanged struct{ ActionType }
type ViewFmt struct{ ActionType }
type ViewPreSave struct{ ActionType }
type ViewSaved struct{ ActionType }
type ViewLoaded struct{ ActionType }
type unmount struct{ ActionType }