bootstrap

package
v0.0.0-...-fb7f86c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DefaultDecorateFuncs are the default DecorateFuncs used for the Decorate step of the Bootstrap stage.

Functions

func AliasDecorateFunc

func AliasDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error)

AliasDecorateFunc is a DecorateFunc that sets the alias for the plugin.

func AppChildDecorateFunc

func AppChildDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error)

AppChildDecorateFunc is a DecorateFunc that configures child plugins of app plugins.

func AppDefaultNavURLDecorateFunc

func AppDefaultNavURLDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error)

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.

func New

func New(cfg *config.Cfg, opts Opts) *Bootstrap

New returns a new Bootstrap stage.

func (*Bootstrap) Bootstrap

func (b *Bootstrap) Bootstrap(ctx context.Context, src plugins.PluginSource, found []*plugins.FoundBundle) ([]*plugins.Plugin, error)

Bootstrap will execute the Construct and Decorate steps of the Bootstrap stage.

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

type DecorateFunc func(ctx context.Context, p *plugins.Plugin) (*plugins.Plugin, error)

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL