/
collections.go
71 lines (63 loc) · 1.66 KB
/
collections.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
package resource
type ResourceList interface {
Append(res Resource) ResourceList
AppendList(list ResourceList) ResourceList
Slice(first, second int) ResourceList
At(idx int) Resource
Set(idx int, res Resource)
Length() int
}
type ResourceChangeList interface {
Append(change ResourceChange) ResourceChangeList
AppendList(list ResourceChangeList) ResourceChangeList
Slice(first, second int) ResourceChangeList
At(idx int) ResourceChange
Set(idx int, change ResourceChange)
Length() int
}
type NameList interface {
Append(res Name) NameList
AppendList(list NameList) NameList
Slice(first, second int) NameList
At(idx int) Name
Set(idx int, name Name)
Length() int
}
type ReferenceList interface {
Append(ref Reference) ReferenceList
AppendList(list ReferenceList) ReferenceList
Slice(first, second int) ReferenceList
At(idx int) Reference
Set(idx int, ref Reference)
Length() int
}
type ParentNameList interface {
Append(res Name) ParentNameList
AppendList(list ParentNameList) ParentNameList
Slice(first, second int) ParentNameList
At(idx int) Name
Set(idx int, name Name)
Length() int
}
type ParentReferenceList interface {
Append(ref Reference) ParentReferenceList
AppendList(list ParentReferenceList) ParentReferenceList
Slice(first, second int) ParentReferenceList
At(idx int) Reference
Set(idx int, ref Reference)
Length() int
}
type ResourceMap interface {
Get(name Name) Resource
Set(change Resource)
Delete(name Name)
Length() int
ForEach(cb func(Name, Resource) bool)
}
type ResourceChangeMap interface {
Get(name Name) ResourceChange
Set(change ResourceChange)
Delete(name Name)
Length() int
ForEach(cb func(Name, ResourceChange) bool)
}