Hello Cap'n Proto users!

If you're using go-capnproto2 <https://github.com/zombiezen/go-capnproto2>,
there's a new subpackage: pogs (Plain Ol' Go Structs).  It exposes two
easy-to-use functions that convert Cap'n Proto structs to and from plain Go
structs using reflection.  This means that you can define structs that do
narrow reads and writes, similar to the encoding/json package in Go's
standard library.

This method of using go-capnproto2 is fully interoperable with existing
code: under the hood, the pogs package uses the same logic for accessing
and setting fields as the generated code, but it walks over the Cap'n Proto
schema and the Go reflection API to map between the two.  Obviously, this
will be slower than accessing fields using the generated code since it uses
reflection and copies memory.  However, for less performance-sensitive
code, this may be an acceptable tradeoff.

This feature is well unit-tested, but is relatively new code, so please
file bugs as you find rough edges.  To grab this package, run `go get -u
zombiezen.com/go/capnproto2/pogs` and check out the docs on godoc
<https://godoc.org/zombiezen.com/go/capnproto2/pogs>.

-Ross

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to