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

Method Decoder

dagql/server.go:2455–2471  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2453}
2454
2455func (InputObject[T]) Decoder() InputDecoder {
2456 return DecoderFunc(func(val any) (Input, error) {
2457 vals, ok := val.(map[string]any)
2458 if !ok {
2459 return nil, fmt.Errorf("expected map[string]any, got %T", val)
2460 }
2461 var obj T
2462 fields, err := setInputObjectFields(&obj, vals)
2463 if err != nil {
2464 return nil, err
2465 }
2466 return InputObject[T]{
2467 Value: obj,
2468 fields: fields,
2469 }, nil
2470 })
2471}
2472
2473type inputObjectField struct {
2474 name string

Callers

nothing calls this directly

Calls 2

DecoderFuncFuncType · 0.85
setInputObjectFieldsFunction · 0.85

Tested by

no test coverage detected