MCPcopy Index your code
hub / github.com/dagger/dagger / ObjectUserDefaults

Method ObjectUserDefaults

core/module.go:238–248  ·  view source on GitHub ↗

Return local defaults for the specified object An empty string as object name means the constructor.

(ctx context.Context, objName string)

Source from the content-addressed store, hash-verified

236// Return local defaults for the specified object
237// An empty string as object name means the constructor.
238func (mod *Module) ObjectUserDefaults(ctx context.Context, objName string) (*EnvFile, error) {
239 modDefaults, err := mod.UserDefaults(ctx)
240 if err != nil {
241 return nil, err
242 }
243 isMainObject := objName == "" || strings.EqualFold(objName, strings.ReplaceAll(mod.OriginalName, "-", ""))
244 if isMainObject {
245 return modDefaults, nil
246 }
247 return modDefaults.Namespace(ctx, objName)
248}
249
250// ApplyWorkspaceDefaultsToTypeDefs updates constructor arg typedefs based on
251// WorkspaceConfig, so that --help displays the correct default values.

Callers 1

UserDefaultsMethod · 0.80

Calls 2

UserDefaultsMethod · 0.95
NamespaceMethod · 0.45

Tested by

no test coverage detected