I have an api that speaks capnp. I want to store a subset of the incoming message (a specific field) in a db and pass it onwards inside other messages later on. How can I do this?
Here's a rough sketch of events in order:
1. incoming request:
struct IncomingRequest {
dbid @0 :Text;
msg @1 :Msg;
}
2. store that `Msg` field in a db
3. read the `Msg` field back from the db and wrap it in this type and send it on:
struct OutgoingRequest {
action @0 :Text;
critical @1 :Bool;
msg @2 :Msg;
}
I'm using the go v2 and d libraries, in case that matters.