[ANN] Pie - Go plugins over stdin/stdout

763 views
Skip to first unread message

Nate Finch

unread,
May 25, 2015, 11:39:48 PM5/25/15
to golan...@googlegroups.com
package: https://github.com/natefinch/pie


Basic idea:  plugins are just external processes that your Go application communicates with via RPC over the plugin's stdin and stdout.  The biggest advantage of this is that anyone can write a plugin for your application in any language.  If your application sets up its plugins to use JSON-RPC, then any application that has a JSON-RPC package can easily be used to make a plugin for your application.

It wasn't a super complicated package to write, but getting the API just right took some tweaking.

Comments and criticisms welcome :)

Tamás Gulácsi

unread,
May 26, 2015, 12:40:58 AM5/26/15
to golan...@googlegroups.com
Great work! Esp. this:
"Functions in this package with the prefix New are intended to be used by the plugin to set up its end of the communication. Functions in this package with the prefix Start are intended to be used by the main application to set up its end of the communication and start a plugin executable.

This package provides two conceptually different types of plugins, based on which side of the communication is the server and which is the client. Plugins which provide an API server for the main application to call are called Providers. Plugins which consume an API provided by the main application are called Consumers."

I think this two paragraph is the essence of the added value.
I'm using the same strategy in one of my apps, to separate general and client-specific code, and the roles are a little bit mind blending.

With this nice separation (New/Start and Producer/Consumer), the roles are clear and concise.

So thanks for investing your thinking cap in it!
Reply all
Reply to author
Forward
0 new messages