registry

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryPoll

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

InMemoryPoll save the plugin to memory.

func NewInMemory

func NewInMemory() *InMemoryPoll

NewInMemory create a memory plugin pool

func ProvideService

func ProvideService() *InMemoryPoll

ProvideService -

func (*InMemoryPoll) Add

Add save a plugin to pool

func (*InMemoryPoll) Plugin

func (i *InMemoryPoll) Plugin(_ context.Context, pluginID string) (*plugins.Plugin, bool)

Plugin load a plugin

func (*InMemoryPoll) Plugins

func (i *InMemoryPoll) Plugins(_ context.Context) []*plugins.Plugin

Plugins load all plugins

func (*InMemoryPoll) Remove

func (i *InMemoryPoll) Remove(_ context.Context, pluginID string) error

Remove remove a plugin from pool

type Pool

type Pool interface {
	// Plugin finds a plugin by its ID.
	Plugin(ctx context.Context, id string) (*plugins.Plugin, bool)
	// Plugins returns all plugins.
	Plugins(ctx context.Context) []*plugins.Plugin
	// Add adds the provided plugin to the registry.
	Add(ctx context.Context, plugin *plugins.Plugin) error
	// Remove deletes the requested plugin from the registry.
	Remove(ctx context.Context, id string) error
}

Pool is responsible for the internal storing and retrieval of plugins.

Jump to

Keyboard shortcuts

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