blob: 9e94e29e9fe1a5c4ce66c15e34d8bf0558fed4c1 (
plain) (
blame)
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
|
package json
type Factory interface {
Produce(typ NodeType) (Node, error)
Fill(n Node, value any)
}
type Node interface {
ToJSON() string
}
type ObjectNode interface {
Node
Set(k string, v Node)
Get(k string) (Node, bool)
}
type ArrayNode interface {
Node
Append(v Node)
Index(i int) Node
Len() int
}
type StringNode interface {
Node
}
type NumberNode interface {
Node
}
type BooleanNode interface {
Node
}
type NullNode interface {
Node
}
type AcceptParent interface {
SetParent(n Node)
}
|