-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontainer.go
64 lines (51 loc) · 1.19 KB
/
container.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
package gostructurizr
type ContainerNode struct {
sys *SoftwareSystemNode
name string
desc *string
tech *string
tags *TagsNode
components []*ComponentNode
}
func Container(name string) *ContainerNode {
return &ContainerNode{
name: name,
tags: Tags(),
}
}
func (c *ContainerNode) Name() string {
return c.name
}
func (c *ContainerNode) WithDesc(desc string) *ContainerNode {
c.desc = &desc
return c
}
func (c *ContainerNode) Description() *string {
return c.desc
}
func (c *ContainerNode) WithTechnology(tech string) *ContainerNode {
c.tech = &tech
return c
}
func (c *ContainerNode) Technology() *string {
return c.tech
}
func (c *ContainerNode) WithTag(t string) *ContainerNode {
c.tags.Add(t)
return c
}
func (c *ContainerNode) Tags() *TagsNode {
return c.tags
}
func (c *ContainerNode) AddComponent(name string) *ComponentNode {
component := Component(name)
component.node = c
c.components = append(c.components, component)
return component
}
func (c *ContainerNode) Components() []*ComponentNode {
return c.components
}
func (c *ContainerNode) Uses(to Namer, desc string) *RelationShipNode {
return c.sys.model.addRelationShip(c, to, desc)
}