How it works...
The github.com/trustmaster/goflow package works by defining a network/graph, registering some components, and then wiring them together. This can feel a bit error-prone since these are described using strings, but usually this will fail early in runtime until it's set up correctly.
In this recipe, we set up two components, one that base64 encodes an incoming string and one that prints anything passed to it. We connect it to an in channel that is initialized in main.go, and anything passed onto that channel will flow through our pipeline.
A lot of the emphasis of this approach is on ignoring the internals of what's going on. We treat everything like a connected black box and let goflow do the rest. You can see in this recipe ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access