MCPcopy Create free account
hub / github.com/dagger/dagger / FieldSpec

Method FieldSpec

dagql/interfaces.go:113–127  ·  view source on GitHub ↗

FieldSpec looks up a field spec by name for the given view.

(name string, view call.View)

Source from the content-addressed store, hash-verified

111
112// FieldSpec looks up a field spec by name for the given view.
113func (iface *Interface) FieldSpec(name string, view call.View) (FieldSpec, bool) {
114 iface.fieldsL.Lock()
115 defer iface.fieldsL.Unlock()
116 versions, ok := iface.fields[name]
117 if !ok {
118 return FieldSpec{}, false
119 }
120 for i := len(versions) - 1; i >= 0; i-- {
121 f := versions[i]
122 if f.MinVersion == "" || f.MinVersion == view {
123 return f.FieldSpec, true
124 }
125 }
126 return FieldSpec{}, false
127}
128
129// ParseField parses an AST field selection against this interface's field specs.
130// This is used when a query selects fields on an interface-typed return value.

Callers 1

ParseFieldMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected