MCPcopy
hub / github.com/dagger/dagger / maybeLoadModule

Method maybeLoadModule

cmd/dagger/shell_fs.go:258–271  ·  view source on GitHub ↗
(ctx context.Context, path string, opts ...dagger.ModuleServeOpts)

Source from the content-addressed store, hash-verified

256}
257
258func (h *shellCallHandler) maybeLoadModule(ctx context.Context, path string, opts ...dagger.ModuleServeOpts) (*moduleDef, *configuredModule, error) {
259 cfg, err := h.parseModRef(ctx, path)
260 if err != nil {
261 return nil, cfg, fmt.Errorf("find module %q: %w", path, err)
262 }
263 if cfg == nil {
264 return nil, nil, nil
265 }
266 def, err := h.getOrInitDef(cfg.Digest, func() (*moduleDef, error) {
267 return initializeModule(ctx, h.dag, cfg.Ref, cfg.Source, opts...)
268 })
269
270 return def, cfg, err
271}
272
273// parseModRef transforms user input into a full module reference that can be used with
274// dag.ModuleSource().

Callers 3

StateLookupMethod · 0.95
InitializeMethod · 0.95
ChangeDirMethod · 0.95

Calls 3

parseModRefMethod · 0.95
getOrInitDefMethod · 0.95
initializeModuleFunction · 0.85

Tested by

no test coverage detected