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

Method newModule

gateway/modules/modules.go:268–285  ·  view source on GitHub ↗
(config *config.ProjectConfig)

Source from the content-addressed store, hash-verified

266}
267
268func (m *Modules) newModule(config *config.ProjectConfig) (*Module, error) {
269 projects := m.projects()
270 m.lock.Lock()
271 defer m.lock.Unlock()
272
273 if ok := m.Managers.Admin().ValidateProjectSyncOperation(projects, config); !ok {
274 helpers.Logger.LogWarn("", "Cannot create new project. Upgrade your plan", nil)
275 return nil, errors.New("upgrade your plan to create new project")
276 }
277
278 module, err := newModule(config.ID, m.clusterID, m.nodeID, m.Managers, m.GlobalMods)
279 if err != nil {
280 return nil, err
281 }
282
283 m.blocks[config.ID] = module
284 return module, nil
285}

Callers 2

SetProjectConfigMethod · 0.95

Calls 6

projectsMethod · 0.95
newModuleFunction · 0.85
AdminMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected