discovery

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discoverer

type Discoverer interface {
	Discover(ctx context.Context, src plugins.PluginSource) ([]*plugins.FoundBundle, error)
}

Discoverer is responsible for the Discovery stage of the plugin loader pipeline.

type Discovery

type Discovery struct {
	// contains filtered or unexported fields
}

Discovery implements the Discoverer interface.

The Discovery stage is made up of the following steps (in order): - Find: Find plugins (from disk, remote, etc.) - Filter: Filter the results based on some criteria.

The Find step is implemented by the FindFunc type.

The Filter step is implemented by the FindFilterFunc type.

func New

func New(cfg *config.PluginManagementCfg, opts Opts) *Discovery

New returns a new Discovery stage.

func (*Discovery) Discover

func (d *Discovery) Discover(ctx context.Context, src plugins.PluginSource) ([]*plugins.FoundBundle, error)

Discover will execute the Find and Filter steps of the Discovery stage.

type FindFilterFunc

type FindFilterFunc func(ctx context.Context, class plugins.Class, bundles []*plugins.FoundBundle) ([]*plugins.FoundBundle, error)

FindFilterFunc is the function used for the Filter step of the Discovery stage.

func NewPermittedPluginTypesFilterStep

func NewPermittedPluginTypesFilterStep(permittedTypes []plugins.Type) FindFilterFunc

NewPermittedPluginTypesFilterStep returns a new FindFilterFunc for filtering out any plugins that are not of a permitted type. This includes both the primary plugin and any child plugins.

type FindFunc

type FindFunc func(ctx context.Context, src plugins.PluginSource) ([]*plugins.FoundBundle, error)

FindFunc is the function used for the Find step of the Discovery stage.

func DefaultFindFunc

func DefaultFindFunc(cfg *config.PluginManagementCfg) FindFunc

DefaultFindFunc is the default function used for the Find step of the Discovery stage. It will scan the local filesystem for plugins.

type Opts

type Opts struct {
	FindFunc        FindFunc
	FindFilterFuncs []FindFilterFunc
}

type PermittedPluginTypesFilter

type PermittedPluginTypesFilter struct {
	// contains filtered or unexported fields
}

PermittedPluginTypesFilter is a filter step that will filter out any plugins that are not of a permitted type.

func (*PermittedPluginTypesFilter) Filter

Filter will filter out any plugins that are not of a permitted type.

Jump to

Keyboard shortcuts

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