Documentation
¶
Index ¶
- func AppDefaultNavURLDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error)
- func TemplateDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error)
- type Bootstrap
- type Bootstrapper
- type ConstructFunc
- type DecorateFunc
- type DefaultConstructor
- type DefaultPluginFactory
- type Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppDefaultNavURLDecorateFunc ¶
AppDefaultNavURLDecorateFunc is a DecorateFunc that sets the default nav URL for app plugins.
Types ¶
type Bootstrap ¶
type Bootstrap struct {
// contains filtered or unexported fields
}
Bootstrap implements the Bootstrapper interface.
The Bootstrap stage is made up of the following steps (in order): - Construct: Create the initial plugin structs based on the plugin(s) found in the Discovery stage. - Decorate: Decorate the plugins with additional metadata.
The Construct step is implemented by the ConstructFunc type.
The Decorate step is implemented by the DecorateFunc type.
type Bootstrapper ¶
type Bootstrapper interface {
Bootstrap(ctx context.Context, src plugins.PluginSource, bundle *plugins.FoundBundle) ([]*plugins.Plugin, error)
}
Bootstrapper is responsible for the Bootstrap stage of the plugin loader pipeline.
type ConstructFunc ¶
type ConstructFunc func(ctx context.Context, src plugins.PluginSource, bundle *plugins.FoundBundle) ([]*plugins.Plugin, error)
ConstructFunc is the function used for the Construct step of the Bootstrap stage.
func DefaultConstructFunc ¶
func DefaultConstructFunc(signatureCalculator plugins.SignatureCalculator, assetPath *assetpath.Service) ConstructFunc
DefaultConstructFunc is the default ConstructFunc used for the Construct step of the Bootstrap stage.
type DecorateFunc ¶
DecorateFunc is the function used for the Decorate step of the Bootstrap stage.
func AppChildDecorateFunc ¶
func AppChildDecorateFunc() DecorateFunc
AppChildDecorateFunc is a DecorateFunc that configures child plugins of app plugins.
func DefaultDecorateFuncs ¶
func DefaultDecorateFuncs(cfg *config.PluginManagementCfg) []DecorateFunc
DefaultDecorateFuncs are the default DecorateFuncs used for the Decorate step of the Bootstrap stage.
func SkipHostEnvVarsDecorateFunc ¶
func SkipHostEnvVarsDecorateFunc(cfg *config.PluginManagementCfg) DecorateFunc
SkipHostEnvVarsDecorateFunc returns a DecorateFunc that configures the SkipHostEnvVars field of the plugin. It will be set to true if the FlagPluginsSkipHostEnvVars feature flag is set, and the plugin is not present in the ForwardHostEnvVars plugin ids list.
type DefaultConstructor ¶
type DefaultConstructor struct {
// contains filtered or unexported fields
}
DefaultConstructor implements the default ConstructFunc used for the Construct step of the Bootstrap stage.
It uses a pluginFactoryFunc to create plugins and the signatureCalculator to calculate the plugin's signature state.
func NewDefaultConstructor ¶
func NewDefaultConstructor(signatureCalculator plugins.SignatureCalculator, assetPath *assetpath.Service) *DefaultConstructor
NewDefaultConstructor returns a new DefaultConstructor.
func (*DefaultConstructor) Construct ¶
func (c *DefaultConstructor) Construct(ctx context.Context, src plugins.PluginSource, bundle *plugins.FoundBundle) ([]*plugins.Plugin, error)
Construct will calculate the plugin's signature state and create the plugin using the pluginFactoryFunc.
type DefaultPluginFactory ¶
type DefaultPluginFactory struct {
// contains filtered or unexported fields
}
DefaultPluginFactory is the default plugin factory used by the Construct step of the Bootstrap stage.
It creates the plugin using plugin information found during the Discovery stage and makes use of the assetPath service to set the plugin's BaseURL, Module, Logos and Screenshots fields.
func NewDefaultPluginFactory ¶
func NewDefaultPluginFactory(assetPath *assetpath.Service) *DefaultPluginFactory
NewDefaultPluginFactory returns a new DefaultPluginFactory.
type Opts ¶
type Opts struct { ConstructFunc ConstructFunc DecorateFuncs []DecorateFunc }