manager

package
v0.0.0-...-955c50f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 6

Documentation

Overview

Package manager encapsulates everything related to long running plugin manager that starts, stops & configures long running plugins

Package manager encapsulates everything related to long running plugin manager that starts, stops & configures long running plugins

Package manager encapsulates everything related to long running plugin manager that starts, stops & configures long running plugins

Package manager encapsulates everything related to long running plugin manager that starts, stops & configures long running plugins

Index

Constants

View Source
const (
	//Name is the core module name for long running plugins manager
	Name = "LongRunningPluginsManager"

	// NameOfCloudWatchJsonFile is the name of ec2 config cloudwatch local configuration file
	NameOfCloudWatchJsonFile = "AWS.EC2.Windows.CloudWatch.json"

	//NumberOfLongRunningPluginWorkers represents number of long-running workers
	NumberOfLongRunningPluginWorkers = 5

	//NumberOfCancelWorkers represents number of cancel workers
	NumberOfCancelWorkers = 5

	// PollFrequencyMinutes represents poll frequency for managing lifecycle of long running plugins
	PollFrequencyMinutes = 15

	// StopTimeout is the time before the manager will be shutdown during a stop = 24 seconds
	StopTimeout = 24 * time.Second
)

Variables

This section is empty.

Functions

func CreateResult

func CreateResult(msg string, status contracts.ResultStatus, res *contracts.PluginResult)

func EnsureInitialization

func EnsureInitialization(context context.T)

EnsureManagerIsInitialized ensures that manager is initialized at least once

func Invoke

func Invoke(context context.T, pluginID string, res *contracts.PluginResult, orchestrationDir string)

func RegisteredPlugins

func RegisteredPlugins(context context.T) map[string]plugin.Plugin

RegisteredPlugins loads all registered long running plugins in memory

Types

type Manager

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

Manager is the core module - that manages long running plugins

func GetInstance

func GetInstance() (*Manager, error)

GetInstance returns an instance of Manager if its initialized otherwise it returns an error

func (*Manager) EnsurePluginRegistered

func (m *Manager) EnsurePluginRegistered(name string, plugin managerContracts.Plugin) (err error)

EnsurePluginRegistered adds a long-running plugin if it is not already in the registry

func (*Manager) GetRegisteredPlugins

func (m *Manager) GetRegisteredPlugins() map[string]managerContracts.Plugin

GetRegisteredPlugins returns a map of all registered long running plugins

func (*Manager) ModuleExecute

func (m *Manager) ModuleExecute() (err error)

Execute starts long running plugin manager

func (*Manager) ModuleName

func (m *Manager) ModuleName() string

Name returns the module name

func (*Manager) ModuleStop

func (m *Manager) ModuleStop() (err error)

RequestStop handles the termination of the long running plugin manager

func (*Manager) StartPlugin

func (m *Manager) StartPlugin(name, configuration string, orchestrationDir string, cancelFlag task.CancelFlag, out iohandler.IOHandler) (err error)

StartPlugin starts the given plugin with the given configuration

func (*Manager) StopPlugin

func (m *Manager) StopPlugin(name string, cancelFlag task.CancelFlag) (err error)

StopPlugin stops a given plugin from executing

type T

type T interface {
	contracts.ICoreModule
	GetRegisteredPlugins() map[string]managerContracts.Plugin
	StopPlugin(name string, cancelFlag task.CancelFlag) (err error)
	StartPlugin(name, configuration string, orchestrationDir string, cancelFlag task.CancelFlag, out iohandler.IOHandler) (err error)
	EnsurePluginRegistered(name string, plugin managerContracts.Plugin) (err error)
}

T manages long running plugins - get information of long running plugins and starts, stops & configures long running plugins

Jump to

Keyboard shortcuts

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