<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Plugins on</title><link>/tags/plugins/</link><description>Recent content in Plugins on</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 21 Nov 2024 00:00:00 +0000</lastBuildDate><atom:link href="/tags/plugins/index.xml" rel="self" type="application/rss+xml"/><item><title>Lesson 2: gRPC-Based Plugin Architecture — How Terraform and Vault do plugins</title><link>/post/go/go-plugins-grpc/</link><pubDate>Thu, 21 Nov 2024 00:00:00 +0000</pubDate><guid>/post/go/go-plugins-grpc/</guid><description>&lt;p&gt;After I understood how &lt;code&gt;hashicorp/go-plugin&lt;/code&gt; worked with net/rpc, the next question was obvious: how does Terraform manage hundreds of community-contributed providers, written by different teams, evolving on different schedules, sometimes in languages other than Go? The answer is gRPC. Terraform&amp;rsquo;s provider protocol is a protobuf schema, communicated over the same subprocess-plus-RPC architecture from Lesson 1 — but with gRPC instead of net/rpc. That substitution buys you schema evolution, multi-language support, streaming, and a strongly-typed IDL. This lesson shows you how to build a plugin system using that pattern.&lt;/p&gt;</description></item><item><title>Lesson 1: Go Plugins and hashicorp/go-plugin — Extending Go apps without recompiling</title><link>/post/go/go-plugins-basics/</link><pubDate>Mon, 26 Aug 2024 00:00:00 +0000</pubDate><guid>/post/go/go-plugins-basics/</guid><description>&lt;p&gt;The first time I needed a plugin system in Go, I went straight to &lt;code&gt;plugin.Open&lt;/code&gt; in the standard library. Ten minutes later I was reading about RTLD flags and shared library loading on Linux, discovering that plugins had to be compiled with the same Go toolchain version as the host, and learning that once a plugin was loaded it could not be unloaded. My enthusiasm dropped sharply. Then I found &lt;code&gt;hashicorp/go-plugin&lt;/code&gt; and understood that the Go community had largely agreed: real plugin systems in Go should run plugins as separate processes communicating over RPC, not as shared libraries in the same process.&lt;/p&gt;</description></item></channel></rss>