MCPcopy Create free account
hub / github.com/compose-spec/compose-go / loadModelWithContext

Function loadModelWithContext

loader/loader.go:369–380  ·  view source on GitHub ↗

LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary

(ctx context.Context, configDetails *types.ConfigDetails, opts *Options)

Source from the content-addressed store, hash-verified

367
368// LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary
369func loadModelWithContext(ctx context.Context, configDetails *types.ConfigDetails, opts *Options) (map[string]any, error) {
370 if len(configDetails.ConfigFiles) < 1 {
371 return nil, errors.New("no compose file specified")
372 }
373
374 err := projectName(configDetails, opts)
375 if err != nil {
376 return nil, err
377 }
378
379 return load(ctx, *configDetails, opts, nil)
380}
381
382func ToOptions(configDetails *types.ConfigDetails, options []func(*Options)) *Options {
383 opts := &Options{

Callers 2

LoadWithContextFunction · 0.85
LoadModelWithContextFunction · 0.85

Calls 2

projectNameFunction · 0.85
loadFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…