MCPcopy
hub / github.com/spacecloud-io/space-cloud / SetInitialProjectConfig

Method SetInitialProjectConfig

gateway/modules/modules.go:43–58  ·  view source on GitHub ↗

SetInitialProjectConfig sets the config all modules

(ctx context.Context, projects config.Projects)

Source from the content-addressed store, hash-verified

41
42// SetInitialProjectConfig sets the config all modules
43func (m *Modules) SetInitialProjectConfig(ctx context.Context, projects config.Projects) error {
44 for projectID, project := range projects {
45 module, err := m.loadModule(projectID)
46 if err != nil {
47 module, err = m.newModule(project.ProjectConfig)
48 if err != nil {
49 return err
50 }
51 }
52
53 if err := module.SetInitialProjectConfig(ctx, config.Projects{projectID: project}); err != nil {
54 return err
55 }
56 }
57 return nil
58}
59
60// SetProjectConfig sets the config all modules
61func (m *Modules) SetProjectConfig(ctx context.Context, config *config.ProjectConfig) error {

Callers

nothing calls this directly

Calls 3

loadModuleMethod · 0.95
newModuleMethod · 0.95

Tested by

no test coverage detected