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

Function LoadWithContext

loader/loader.go:353–360  ·  view source on GitHub ↗

LoadWithContext reads a ConfigDetails and returns a fully loaded configuration as a compose-go Project

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

Source from the content-addressed store, hash-verified

351
352// LoadWithContext reads a ConfigDetails and returns a fully loaded configuration as a compose-go Project
353func LoadWithContext(ctx context.Context, configDetails types.ConfigDetails, options ...func(*Options)) (*types.Project, error) {
354 opts := ToOptions(&configDetails, options)
355 dict, err := loadModelWithContext(ctx, &configDetails, opts)
356 if err != nil {
357 return nil, err
358 }
359 return ModelToProject(dict, opts, configDetails)
360}
361
362// LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary
363func LoadModelWithContext(ctx context.Context, configDetails types.ConfigDetails, options ...func(*Options)) (map[string]any, error) {

Callers 15

LoadProjectMethod · 0.92
TestDevelopWatchFunction · 0.92
TestDevelopMissingActionFunction · 0.92
loadFunction · 0.92
loadWithEnvFunction · 0.92
loadRoundTripFunction · 0.92
TestProfilesFunction · 0.92
Test_LoadWithResetFunction · 0.85

Calls 3

ToOptionsFunction · 0.85
loadModelWithContextFunction · 0.85
ModelToProjectFunction · 0.85

Tested by 15

TestDevelopWatchFunction · 0.74
TestDevelopMissingActionFunction · 0.74
loadFunction · 0.74
loadWithEnvFunction · 0.74
loadRoundTripFunction · 0.74
TestProfilesFunction · 0.74
Test_LoadWithResetFunction · 0.68
Test_DuplicateResetFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…