duanmu6752 2011-11-07 03:47 采纳率: 0%
浏览 22
已采纳

如何使用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?

  • 写回答

1条回答 默认 最新

  • dongyihang3575 2011-11-07 12:07
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 BV260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序