Skip to main content
Version: 0.15.0

Building a Plugin

This section writes a Plugin from nothing and takes it as far as somebody else can use it. It starts from the family's template, which the composer turns into a Plugin project, and goes through the program, a run under a Core, the other things a Plugin can be asked to do, and the tag it is published at. Every page also keeps, at its end, the same steps by hand. What a Plugin is, and how it differs from an application, is Plugins and applications; this section assumes it.

One Plugin runs through every page: com.example.greeter. It answers the question greeter.hello with a greeting, and later it is also told which greeting to use. It is written five times, once with each family's library, and every page shows the five as tabs. Choosing a language on one page chooses it on all of them.

PageWhat it covers
Starting itthe Plugin project the composer makes from the family's template, and the library it depends on
The programthe declaration, the start, answering a question, the orderly close, the build, and the Manifest kept in the source
Trying ittry/, the smallest application around it, a run under a local Core, a grant, and what to read when it is refused
More than a questiona command it acknowledges, an occurrence it reports, and the streams and needs it may declare
Handing it onthe source at a tag, the executable and the Manifest, and where each form of an application takes them

A Plugin is used in an application, and a Plugin is not an application. This section builds the smallest application only to run the Plugin. Writing a real one, from Plugins that already exist, is Building an application.

What you need​

Yoke installed on this machine, with the composer. Setting up Yoke obtains the two files of a release: yoke-<version>-linux-<arch>.tar.gz, the programs a host runs, and yoke-conformance-<version>-linux-<arch>.tar.gz, which carries yoke-compose. It then installs them. Installing for your account alone is enough, and nothing in this section needs root. The composer starts a Plugin from a template its family publishes with each release: Go, Rust, C and C++ have one; Python's comes later, and a Python Plugin is started by hand.

And the toolchain of the language you write in:

You needFor
Go 1.26 or newerbuilding; the library is a module, fetched by go get

Every family offers the same contract, and the model is the same in each: a declaration, a start that registers, events to answer, an orderly close. Only the spelling follows the language (what each family offers).