NewRuntime creates a new runtime and inits default nodes
(eh *EventHandler, nodes ...Node)
| 18 | |
| 19 | // NewRuntime creates a new runtime and inits default nodes |
| 20 | func NewRuntime(eh *EventHandler, nodes ...Node) Runtime { |
| 21 | local := Node{ |
| 22 | Name: "local", |
| 23 | Type: "local", |
| 24 | Addr: "localhost", |
| 25 | } |
| 26 | |
| 27 | nodes = append(nodes, local) |
| 28 | runner := Runner{ |
| 29 | Nodes: nodes, |
| 30 | } |
| 31 | |
| 32 | return Runtime{ |
| 33 | Runner: &runner, |
| 34 | EventHandler: eh, |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // Runtime represents the current runtime, please use NewRuntime() instead of creating an instance directly |
| 39 | type Runtime struct { |
no outgoing calls