Skip to main content

Registry

This class resolves a pluginsCore.Plugin for a given task type by wrapping the global plugin registry. It wraps K8s plugins in a PluginManager and loads core plugins via their PluginLoader.

Methods


Initialize()

@classmethod
def Initialize(
ctx: context.Context
) - > error

Initializes the plugin registry with a given context. This method sets up the necessary context for plugins to operate.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the plugin initialization, used to carry deadlines, cancellation signals, and other request-scoped values.

Returns

TypeDescription
errorAn error if the initialization fails, otherwise nil.

ResolvePlugin()

@classmethod
def ResolvePlugin(
taskType: string
) - > (pluginsCore.Plugin, error)

Resolves and returns a plugin for a given task type. Callers use this to obtain the correct plugin instance to handle a specific task.

Parameters

NameTypeDescription
taskTypestringThe string identifier for the type of task for which a plugin is required.

Returns

TypeDescription
(pluginsCore.Plugin, error)The resolved plugin instance and an error if no plugin is found for the given task type.