plugkit

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 2 Imported by: 0

README

PlugKit

GitHub License GitHub Tag GitHub last commit

PlugKit to stupidly simple, stream-capable plugin runtime for Go.
No gRPC. No protobuf. No codegen.
Just structs, CBOR, pipes and a handshake.

✨ Why PlugKit?

PlugKit is a micro-framework that lets you:

  • create and run plugins as separate processes (we call them simply plugs)
  • communicate with them over stdin/stdout
  • pass arbitrary Go structs encoded with CBOR
  • use bidirectional message routing
  • gracefully terminate a plug whenever you want (Finish)

It's like HashiCorp’s go-plugin, but:

  • without the pain
  • without reflection
  • without type registries
  • with streaming message support 😎 (in future)

🧪 Status

PlugKit is under active development.
The API will evolve slightly, but the core already works:

  • ✅ Running plugins as separate processes
  • ✅ Bidirectional communication (host <-> plugin)
  • ✅ CBOR serialization (fxamacker/cbor)
  • ✅ Handling multiple message types
  • Finish() with exit code support
  • ⏳ Handshake with capabilities negotiation
  • ⏳ Unit tests
  • ⏳ API documentation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndRunPlug added in v0.0.3

func CreateAndRunPlug(handlers *[]options.CommandHandler) error

CreateAndRunPlug builds and runs a SmartPlug instance using the provided list of handlers.

It is designed for functional-style plugin declarations, where a slice of message-command handlers is passed in and automatically registered.

The function will block until the SmartPlug finishes execution and return any error reported during its lifecycle.

func NewPlug added in v0.0.3

func NewPlug() *plug.SmartPlug

NewPlug returns a new, empty SmartPlug instance.

This is a shortcut for plug.New(), useful for clarity or abstraction when exposing PlugKit in higher-level packages.

Types

This section is empty.

Directories

Path Synopsis
Package client provides a standard PlugKit host implementation.
Package client provides a standard PlugKit host implementation.
examples
Package plug provides the default runtime for a PlugKit-compatible plugin.
Package plug provides the default runtime for a PlugKit-compatible plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL