forked from manhcuongbk56/cypher-go-dsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node_labels.go
52 lines (43 loc) · 880 Bytes
/
node_labels.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
package cypher
type NodeLabels struct {
values []NodeLabel
notNil bool
key string
err error
}
func NodeLabelsCreate(values []NodeLabel) NodeLabels {
for _, value := range values {
if value.GetError() != nil {
return NodeLabelsError(value.GetError())
}
}
n := NodeLabels{
values: values,
notNil: true,
}
n.key = getAddress(&n)
return n
}
func NodeLabelsError(err error) NodeLabels {
return NodeLabels{err: err}
}
func (n NodeLabels) GetError() error {
return n.err
}
func (n NodeLabels) accept(visitor *CypherRenderer) {
visitor.enter(n)
for _, value := range n.values {
value.accept(visitor)
}
visitor.leave(n)
}
func (n NodeLabels) enter(renderer *CypherRenderer) {
}
func (n NodeLabels) leave(renderer *CypherRenderer) {
}
func (n NodeLabels) getKey() string {
return n.key
}
func (n NodeLabels) isNotNil() bool {
return n.notNil
}