Core features of go-plugin
mainThe go-plugin system provides several production-ready features for building robust plugin architectures:
- Go Interface Implementation: Plugins feel like native Go code; authors implement interfaces and users call them as if they were in the same process.
- Cross-language Support: Supports serving plugins via
gRPC, allowing plugins to be written in any major language. - Complex Arguments: Supports
io.Reader,io.Writer, and other complex types via theMuxBrokerlibrary. - Bidirectional Communication: Allows the host to pass interface implementations to the plugin, enabling callbacks into the host.
- Built-in Logging: Automatically mirrors plugin
logoutput to the host, prefixed with the plugin path. Supports structured logging ifhclogis used by both parties. - Protocol Versioning: Supports a basic protocol version to invalidate incompatible plugins when interface signatures change.
- Stdout/Stderr Syncing: Mirrors plugin stdout/stderr to the host process.
- TTY Preservation: Connects plugin
stdinto the host'sstdin, allowing interactive tools (likessh) to work within a plugin. - Host Upgrades: Supports reattaching to running plugins via
ReattachConfiginNewClientto allow host process upgrades. - Security: Supports cryptographic verification via checksums and encrypted RPC communication using TLS.