-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.go
45 lines (38 loc) · 1.38 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
package ruleeng
// Action ...
// See DefaultAction for an example implementation.
type Action interface {
GetName() string
GetParameters() map[string]interface{}
GetMetaData() map[string]interface{}
GetEnabledDependsAction() bool
GetEnableDependsForALLAction() bool
}
// DefaultAction default action implementation
type DefaultAction struct {
Name string `json:"name"`
Parameters map[string]interface{} `json:"parameters"`
MetaData map[string]interface{} `json:"metaData"`
EnabledDependsAction bool `json:"enabledDepends"`
EnableDependsForALLAction bool `json:"enableDependsForALLAction"`
}
// GetParameters returns the action parameters
func (a DefaultAction) GetParameters() map[string]interface{} {
return a.Parameters
}
// GetMetaData returns the action metadata
func (a DefaultAction) GetMetaData() map[string]interface{} {
return a.MetaData
}
// GetName returns the action name
func (a DefaultAction) GetName() string {
return a.Name
}
// GetDisableDepends return if the action agrees dependency management
func (a DefaultAction) GetEnabledDependsAction() bool {
return a.EnabledDependsAction
}
// GetEnableDependsForALLAction return if the case supports dependency management
func (a DefaultAction) GetEnableDependsForALLAction() bool {
return a.EnableDependsForALLAction
}