Documentation
¶
Index ¶
- type Context
- type MenuItem
- type NavBehavior
- type Plugin
- type PluginFactory
- type PluginMeta
- type Registry
- func (r *Registry) All() []Plugin
- func (r *Registry) Build(svc sdk.Service, configs map[string]config.PluginConfig)
- func (r *Registry) ByID(id string) (Plugin, bool)
- func (r *Registry) ByKey(key string) (Plugin, bool)
- func (r *Registry) MenuItems() []MenuItem
- func (r *Registry) NavBehaviorFor(id string) NavBehavior
- func (r *Registry) RegisterFactory(id string, factory PluginFactory, meta PluginMeta)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context is a type alias for the SDK Context type. Internal packages can continue to reference plugin.Context. New code should prefer pkg/sdk.
type NavBehavior ¶ added in v1.5.0
type NavBehavior int
NavBehavior describes how a plugin enters the navigation.
const ( NavReplace NavBehavior = iota NavPush )
type Plugin ¶
Plugin is a type alias for the SDK Plugin interface. Internal packages can continue to reference plugin.Plugin. New code should prefer pkg/sdk.
type PluginFactory ¶
type PluginFactory = sdk.PluginFactory
PluginFactory is a type alias for the SDK PluginFactory type.
type PluginMeta ¶
PluginMeta holds external routing metadata for a plugin. Plugins themselves are invocation-agnostic — keybinding and menu visibility are controlled here.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered plugin factories and their instantiated plugins. It supports lookup by key binding or plugin ID.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry creates a new empty Registry with no registered factories or plugins.
func (*Registry) Build ¶
Build instantiates all enabled plugins from registered factories and applies their configuration. Plugins not present in the configs map are enabled by default.
func (*Registry) ByID ¶
ByID looks up a plugin by its unique identifier and reports whether it was found.
func (*Registry) ByKey ¶
ByKey looks up a plugin by its key binding string and reports whether it was found.
func (*Registry) MenuItems ¶
MenuItems returns the list of menu entries for plugins that are visible in the home menu, in registration order.
func (*Registry) NavBehaviorFor ¶ added in v1.5.0
func (r *Registry) NavBehaviorFor(id string) NavBehavior
NavBehaviorFor returns the navigation mode for the given plugin ID.
func (*Registry) RegisterFactory ¶
func (r *Registry) RegisterFactory(id string, factory PluginFactory, meta PluginMeta)
RegisterFactory registers a plugin factory by its unique ID along with its routing metadata. The factory is not invoked until Build is called, allowing all factories to be registered before configuration is applied.