-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
features.go
47 lines (42 loc) · 899 Bytes
/
features.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
package classifier
type features struct {
conditions []conditionDefinition
actions []actionDefinition
}
type feature func(*features)
func newFeatures(fs ...feature) features {
result := features{}
for _, f := range fs {
f(&result)
}
return result
}
func compilerFeatures(features features) compilerOption {
return func(_ Source, c *compilerContext) error {
c.features = features
return nil
}
}
var defaultFeatures = newFeatures(
conditions(
andCondition{},
notCondition{},
orCondition{},
expressionCondition{},
),
actions(
addTagAction{},
attachLocalContentByIdAction{},
attachLocalContentBySearchAction{},
attachTmdbContentByIdAction{},
attachTmdbContentBySearchAction{},
deleteAction{},
findMatchAction{},
ifElseAction{},
unmatchedAction{},
parseDateAction{},
parseVideoContentAction{},
runWorkflowAction{},
setContentTypeAction{},
),
)