plugin

package
v0.32.12 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unmanaged = "unmanaged"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreationOptions

type CreationOptions struct {
	Provider registry.Provider
	// Alias to name plugin on creation
	Alias string
	// Environment variables to pass to plugin binary on creation
	Env []string
}

type Manager

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

Manager handles lifecycle execution of CloudQuery providers

func NewManager

func NewManager(r registry.Registry, opts ...ManagerOption) (*Manager, error)

func (*Manager) ClosePlugin

func (m *Manager) ClosePlugin(p Plugin)

ClosePlugin kills a plugin instance and removes it from the managed plugins.

func (*Manager) CreatePlugin

func (m *Manager) CreatePlugin(opts *CreationOptions) (Plugin, error)

CreatePlugin creates a plugin based on CreationOptions

func (*Manager) DownloadProviders

func (m *Manager) DownloadProviders(ctx context.Context, providers []registry.Provider, noVerify bool) ([]registry.ProviderBinary, error)

DownloadProviders downloads one or more registry.Provider from the registry.Registry, if we want to skip provider verification when downloading pass true on `noVerify`

func (*Manager) IsReattachProvider

func (m *Manager) IsReattachProvider(rp registry.Provider) bool

func (*Manager) Shutdown

func (m *Manager) Shutdown()

Shutdown closes all clients and cleans the managed clients

type ManagerOption

type ManagerOption func(m *Manager)

func WithAllowReattach

func WithAllowReattach() ManagerOption

WithAllowReattach allows plugin reattach to be supported by Manager

type Plugin

type Plugin interface {
	Name() string
	Version() string
	ProtocolVersion() int
	Provider() cqproto.CQProvider
	Close()
}

type Plugins

type Plugins map[string]Plugin

func (Plugins) Get

func (pm Plugins) Get(p registry.Provider, alias string) Plugin

Get returns a Plugin instance from a registry.Provider creation info or it's created alias

Directories

Path Synopsis
Package registry is a generated GoMock package.
Package registry is a generated GoMock package.

Jump to

Keyboard shortcuts

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