Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Descriptor ¶ added in v0.6.5
func Descriptor(id string) (spi.PluginDescriptor, bool)
Descriptor returns the descriptor for a plugin ID.
func Descriptors ¶ added in v0.6.5
func Descriptors() map[string]spi.PluginDescriptor
Descriptors returns all known descriptors.
Types ¶
type Factory ¶ added in v0.6.5
type Factory func( state spi.ServerState, connect http.Handler, workers spi.WorkerRegistry, sched spi.Scheduler, metrics spi.Metrics, stateProvider func() any, version, sha, date string, opts spi.Options, authMW spi.Middleware, ) spi.Plugin
Factory is the common constructor for server extensions.
type PromAdapter ¶ added in v0.6.5
type PromAdapter struct{ *prometheus.Registry }
PromAdapter adapts a Prometheus registry to the SPI MetricsRegistry interface.
func (PromAdapter) MustRegister ¶ added in v0.6.5
func (r PromAdapter) MustRegister(cs ...spi.Collector)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds loaded plugins and their optional capabilities.
func Load ¶
func Load(parent chi.Router, preg *prometheus.Registry, state spi.StateRegistry, plugins []Plugin) *Registry
Load initializes plugins and returns a Registry describing their capabilities.
func (*Registry) WorkerProviders ¶
func (r *Registry) WorkerProviders() []WorkerProvider
WorkerProviders returns plugins that implement WorkerProvider.
type SurfaceMount ¶
type SurfaceMount struct {
Path string
Router chi.Router
Metrics *prometheus.Registry
State spi.StateRegistry
}
SurfaceMount represents a mounted plugin surface.
func RegisterSurface ¶
func RegisterSurface(parent chi.Router, p Plugin, preg *prometheus.Registry, state spi.StateRegistry) SurfaceMount
RegisterSurface mounts a plugin under /api/{id} and wires optional capabilities.
type WorkerProvider ¶
type WorkerProvider = spi.WorkerProvider
WorkerProvider is implemented by plugins that handle load-balanced workers.
Click to show internal directories.
Click to hide internal directories.