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

Method ConvertToSDKInput

core/schema/coremod.go:725–740  ·  view source on GitHub ↗
(ctx context.Context, value dagql.Typed)

Source from the content-addressed store, hash-verified

723}
724
725func (obj *CoreModScalar) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error) {
726 state, err := obj.coreMod.viewState(ctx)
727 if err != nil {
728 return nil, err
729 }
730 s, ok := state.server.ScalarType(obj.name)
731 if !ok {
732 return nil, fmt.Errorf("CoreModScalar.ConvertToSDKInput: found no scalar type")
733 }
734 val, ok := value.(dagql.Scalar[dagql.String])
735 if !ok {
736 // we assume all core scalars are strings
737 return nil, fmt.Errorf("CoreModScalar.ConvertToSDKInput: core scalar should be string")
738 }
739 return s.DecodeInput(string(val.Value))
740}
741
742func (obj *CoreModScalar) CollectContent(ctx context.Context, value dagql.AnyResult, content *core.CollectedContent) error {
743 if value == nil {

Callers

nothing calls this directly

Calls 3

ScalarTypeMethod · 0.65
DecodeInputMethod · 0.65
viewStateMethod · 0.45

Tested by

no test coverage detected