(projectID, clusterID, nodeID string, managers *managers.Managers, globalMods *global.Global)
| 34 | } |
| 35 | |
| 36 | func newModule(projectID, clusterID, nodeID string, managers *managers.Managers, globalMods *global.Global) (*Module, error) { |
| 37 | // Get managers |
| 38 | adminMan := managers.Admin() |
| 39 | syncMan := managers.Sync() |
| 40 | integrationMan := managers.Integration() |
| 41 | |
| 42 | // Get global mods |
| 43 | metrics := globalMods.Metrics() |
| 44 | |
| 45 | c := crud.Init() |
| 46 | c.SetAdminManager(adminMan) |
| 47 | c.SetGetSecrets(syncMan.GetSecrets) |
| 48 | c.SetIntegrationManager(integrationMan) |
| 49 | c.SetCachingModule(globalMods.Caching()) |
| 50 | |
| 51 | s := schema.Init(clusterID, c) |
| 52 | |
| 53 | a := auth.Init(clusterID, nodeID, c, adminMan, integrationMan) |
| 54 | a.SetMakeHTTPRequest(syncMan.MakeHTTPRequest) |
| 55 | |
| 56 | fn := functions.Init(clusterID, a, syncMan, integrationMan, metrics.AddFunctionOperation) |
| 57 | fn.SetCachingModule(globalMods.Caching()) |
| 58 | f := filestore.Init(a, metrics.AddFileOperation) |
| 59 | f.SetGetSecrets(syncMan.GetSecrets) |
| 60 | |
| 61 | e, err := eventing.New(clusterID, projectID, nodeID, a, c, syncMan, f, metrics.AddEventingType) |
| 62 | if err != nil { |
| 63 | return nil, err |
| 64 | } |
| 65 | |
| 66 | f.SetEventingModule(e) |
| 67 | |
| 68 | c.SetHooks(metrics.AddDBOperation) |
| 69 | |
| 70 | rt, err := realtime.Init(projectID, nodeID, e, a, c, s, metrics, syncMan) |
| 71 | if err != nil { |
| 72 | return nil, err |
| 73 | } |
| 74 | |
| 75 | u := userman.Init(c, a) |
| 76 | graphqlMan := graphql.New(a, c, fn, s) |
| 77 | |
| 78 | return &Module{auth: a, db: c, user: u, file: f, functions: fn, realtime: rt, eventing: e, graphql: graphqlMan, schema: s, Managers: managers, GlobalMods: globalMods}, nil |
| 79 | } |
no test coverage detected