Alternatives: HashiCorp go-plugin
RPC-based plugins for cross-platform support
Why go-plugin?
The native Go plugin package is Linux/macOS only, requires identical dependency versions, and cannot unload plugins. HashiCorp go-plugin solves these problems by running plugins as separate processes communicating via RPC (gRPC or net/rpc).
Architecture
go-plugin runs the plugin binary as a subprocess. The host starts it, establishes a gRPC/net/rpc connection, and calls the plugin through a generated client. The plugin process is killed on host exit.
All lessons in this course
- Go plugin Package Basics
- Designing a Plugin Interface
- Dynamic Loading and Symbols
- Alternatives: HashiCorp go-plugin