MCPcopy Create free account
hub / github.com/cortexproject/cortex / AddDependency

Method AddDependency

pkg/util/modules/modules.go:62–69  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

60// AddDependency adds a dependency from name(source) to dependsOn(targets)
61// An error is returned if the source module name is not found
62func (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

Calls

no outgoing calls