workerplugin

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 1 Imported by: 0

README

Worker Plugin Template

This package provides a starting point for plugins that expose load-balanced workers. Copy the directory and implement your own logic:

  1. Update ID() with a unique identifier.
  2. Register any HTTP routes and WebSocket endpoints in RegisterRoutes.
  3. Add Prometheus collectors via RegisterMetrics.
  4. Publish state elements in RegisterState.
  5. Provide a scheduler that dispatches tasks in Scheduler.

The server will automatically detect the WorkerProvider capability when the plugin is loaded.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct{}

Plugin is a minimal example implementing plugin.Plugin and plugin.WorkerProvider.

func New

func New() *Plugin

New returns a new instance of the plugin.

func (*Plugin) ID

func (p *Plugin) ID() string

ID returns the plugin identifier.

func (*Plugin) RegisterMetrics

func (p *Plugin) RegisterMetrics(reg spi.MetricsRegistry)

RegisterMetrics adds Prometheus collectors.

func (*Plugin) RegisterRoutes

func (p *Plugin) RegisterRoutes(r spi.Router)

RegisterRoutes installs HTTP routes served by this plugin.

func (*Plugin) RegisterState

func (p *Plugin) RegisterState(reg spi.StateRegistry)

RegisterState exposes values under /state.

func (*Plugin) Scheduler

func (p *Plugin) Scheduler() spi.Scheduler

Scheduler returns the dispatch scheduler for this plugin.

Jump to

Keyboard shortcuts

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