plugkit

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 8 Imported by: 0

README

PlugKit

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:

  • run plugins as separate processes
  • communicate with them over stdin/stdout
  • pass arbitrary Go structs encoded with CBOR
  • use bidirectional message routing (the plugin can speak first!)
  • gracefully terminate a plugin 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 MustRaw

func MustRaw(v any) cbor.RawMessage

Types

type Client

type Client struct {
	Handlers map[string]func([]byte)
	Wg       *sync.WaitGroup
	// contains filtered or unexported fields
}

func NewClient

func NewClient(name string) *Client

func (*Client) DownloadAndStart

func (c *Client) DownloadAndStart()

func (*Client) HandleMessageType

func (h *Client) HandleMessageType(name string, handler func([]byte))

func (*Client) Init

func (h *Client) Init()

func (*Client) Kill

func (c *Client) Kill()

func (*Client) Respond

func (h *Client) Respond(t string, v any)

func (*Client) RunCommand

func (c *Client) RunCommand(name string, v any)

func (*Client) SetCommand

func (c *Client) SetCommand(command string)

func (*Client) StartLocal

func (c *Client) StartLocal()

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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