Can I pass custom types from one module to the next? I have been serializing my objects as JSON and passing them from one dagger module to the next. https://docs.dagger.io/manuals/developer/custom-types/ . I thought about also using protocol buffers which seems like a lot.
#Custom types as parameters to dagger functions?
1 messages · Page 1 of 1 (latest)
You can accept a custom type from your own module as a parameter, but you cannot accept one from a different module or package. There is an issue were we have been debating the kind of problems we would face if implementing this but I can't seem to find. I'll keep looking
Marshaling/unmarshaling and using a dagger.File or similar is something that I regularly do as well
I have another trick
Would it be possible to use protocol buffers though? Like as a message layer
A bit late, but I found it: https://github.com/dagger/dagger/issues/8529. We haven't discussed this further in the past two weeks, feel free to comment with your use case an thoughts!
Anything that can be marshalled down to an array of bytes can be written to a file and be sent over the wire with dagger. But you won't be able to use the types themselves, you'll have to marshal/unmarshal upon receiving them
Thanks