Documentation ¶
Index ¶
- Variables
- func AliasDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error)
- func AppChildDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error)
- func AppDefaultNavURLDecorateFunc(_ 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 ¶
var DefaultDecorateFuncs = []DecorateFunc{ AliasDecorateFunc, AppDefaultNavURLDecorateFunc, AppChildDecorateFunc, }
DefaultDecorateFuncs are the default DecorateFuncs used for the Decorate step of the Bootstrap stage.
Functions ¶
func AliasDecorateFunc ¶
AliasDecorateFunc is a DecorateFunc that sets the alias for the plugin.
func AppChildDecorateFunc ¶
AppChildDecorateFunc is a DecorateFunc that configures child plugins of 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, bundles []*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, bundles []*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.
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, bundles []*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 }