bootstrap

package
v1.9.2-0...-1a1531c Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

func TemplateDecorateFunc

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

TemplateDecorateFunc is a DecorateFunc that removes the placeholder for the version and last_update fields.

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.

func AppChildDecorateFunc

func AppChildDecorateFunc(cfg *config.Cfg) DecorateFunc

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

func DefaultDecorateFuncs

func DefaultDecorateFuncs(cfg *config.Cfg) []DecorateFunc

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

func SkipHostEnvVarsDecorateFunc

func SkipHostEnvVarsDecorateFunc(cfg *config.Cfg) 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, 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