plugin

package
v0.0.0-...-dc1b377 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// contains filtered or unexported fields
}

Base provides a minimal implementation of the spi.Plugin interface that plugins can embed to inherit default behaviors. It mounts a base route that returns the plugin descriptor and masked options as JSON; concrete plugins can call Base.RegisterRoutes before wiring their own endpoints.

func NewBase

func NewBase(desc spi.PluginDescriptor, opts map[string]string) Base

NewBase constructs a Base with the given plugin descriptor and the plugin's option map (values) for masking and display. Options may be nil.

func (Base) ID

func (b Base) ID() string

ID returns the plugin identifier used in routing (e.g., "/api/{id}").

func (Base) RegisterMetrics

func (b Base) RegisterMetrics(_ spi.MetricsRegistry)

RegisterMetrics is a no-op in the base implementation.

func (Base) RegisterRoutes

func (b Base) RegisterRoutes(r spi.Router)

RegisterRoutes registers a default handler at the plugin root that returns the plugin descriptor and current options (with secrets masked) as JSON. Concrete plugins should call this to provide a default for the base path and then add their specific endpoints.

func (Base) RegisterState

func (b Base) RegisterState(_ spi.StateRegistry)

RegisterState is a no-op in the base implementation.

Jump to

Keyboard shortcuts

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