Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write modular (plug-in) applications with Go?

I understand that the Go programming language doesn't really support dynamic linking. This makes me wonder, what would somebody do if they wanted to write an application that supported third party (or otherwise contributed) plug-ins?

It seems the typical response is that Go compiles quickly, so just recompile, but I don't find this all that practical for system administrators. The Apache web server for example, has an amazing number of modules that can be configured to be loaded (or not loaded) very easily.

Is the only option left to use sockets or other IPC for plugins?

like image 867
andyortlieb Avatar asked Nov 27 '25 13:11

andyortlieb


1 Answers

What I would do, is, set up an API through, say, channel over pipe. And tell the plugin author to issue an exe that communicate over this pipe.

This is similar to how Chrome works today.

This is a way to achieve that over netchan.

Note: the netchan pacakage is deprecated, but the idea is to use RPC over unix pipes.

like image 158
Elazar Leibovich Avatar answered Nov 30 '25 06:11

Elazar Leibovich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!