forked from tliron/puccini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.go
63 lines (55 loc) · 1.62 KB
/
interface.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
package normal
//
// Interface
//
type Interface struct {
NodeTemplate *NodeTemplate `json:"-" yaml:"-"`
Group *Group `json:"-" yaml:"-"`
Relationship *Relationship `json:"-" yaml:"-"`
Name string `json:"-" yaml:"-"`
Description string `json:"description" yaml:"description"`
Types Types `json:"types" yaml:"types"`
Inputs Constrainables `json:"inputs" yaml:"inputs"`
Operations Operations `json:"operations" yaml:"operations"`
Notifications Notifications `json:"notifications" yaml:"notifications"`
}
func (self *NodeTemplate) NewInterface(name string) *Interface {
interface_ := &Interface{
NodeTemplate: self,
Name: name,
Types: make(Types),
Inputs: make(Constrainables),
Operations: make(Operations),
Notifications: make(Notifications),
}
self.Interfaces[name] = interface_
return interface_
}
func (self *Group) NewInterface(name string) *Interface {
interface_ := &Interface{
Group: self,
Name: name,
Types: make(Types),
Inputs: make(Constrainables),
Operations: make(Operations),
Notifications: make(Notifications),
}
self.Interfaces[name] = interface_
return interface_
}
func (self *Relationship) NewInterface(name string) *Interface {
interface_ := &Interface{
Relationship: self,
Name: name,
Types: make(Types),
Inputs: make(Constrainables),
Operations: make(Operations),
Notifications: make(Notifications),
}
self.Interfaces[name] = interface_
return interface_
}
//
// Interfaces
//
type Interfaces map[string]*Interface