initializeWorkspace loads type definitions from the workspace. Modules are already served by the engine at connect time. The CLI consumes workspace entrypoint methods and module constructors directly from the engine schema's Query root.
(ctx context.Context, dag *dagger.Client, opts ...loadTypeDefsOpts)
| 38 | // The CLI consumes workspace entrypoint methods and module constructors |
| 39 | // directly from the engine schema's Query root. |
| 40 | func initializeWorkspace(ctx context.Context, dag *dagger.Client, opts ...loadTypeDefsOpts) (rdef *moduleDef, rerr error) { |
| 41 | ctx, span := Tracer().Start(ctx, "load workspace: .") |
| 42 | defer telemetry.EndWithCause(span, &rerr) |
| 43 | |
| 44 | def := &moduleDef{} |
| 45 | |
| 46 | if err := def.loadTypeDefs(ctx, dag, opts...); err != nil { |
| 47 | return nil, err |
| 48 | } |
| 49 | |
| 50 | return def, nil |
| 51 | } |
| 52 | |
| 53 | // initializeModule loads the module at the given source ref |
| 54 | // |