AddDependency adds a dependency from name(source) to dependsOn(targets) An error is returned if the source module name is not found
(name string, dependsOn ...string)
| 60 | // AddDependency adds a dependency from name(source) to dependsOn(targets) |
| 61 | // An error is returned if the source module name is not found |
| 62 | func (m *Manager) AddDependency(name string, dependsOn ...string) error { |
| 63 | if mod, ok := m.modules[name]; ok { |
| 64 | mod.deps = append(mod.deps, dependsOn...) |
| 65 | } else { |
| 66 | return fmt.Errorf("no such module: %s", name) |
| 67 | } |
| 68 | return nil |
| 69 | } |
| 70 | |
| 71 | // InitModuleServices initialises given modules by initialising all their dependencies |
| 72 | // in the right order. Modules are wrapped in such a way that they start after their |
no outgoing calls