discovery

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: 7 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.Cfg, 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 DuplicatePluginValidation

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

DuplicatePluginValidation is a filter step that will filter out any plugins that are already registered with the registry. This includes both the primary plugin and any child plugins, which are matched using the plugin ID field.

func NewDuplicatePluginFilterStep

func NewDuplicatePluginFilterStep(registry registry.Service) *DuplicatePluginValidation

NewDuplicatePluginFilterStep returns a new DuplicatePluginValidation.

func (*DuplicatePluginValidation) Filter

Filter will filter out any plugins that are already registered with the registry.

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.Cfg) 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