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
Package manager encapsulates everything related to long running plugin manager that starts, stops & configures long running plugins
Index ¶
- Constants
- func EnsureInitialization(context context.T)
- func RegisteredPlugins(context context.T) map[string]plugin.Plugin
- type Manager
- func (m *Manager) EnsurePluginRegistered(name string, plugin managerContracts.Plugin) (err error)
- func (m *Manager) GetRegisteredPlugins() map[string]managerContracts.Plugin
- func (m *Manager) ModuleExecute(context context.T) (err error)
- func (m *Manager) ModuleName() string
- func (m *Manager) ModuleRequestStop(stopType contracts.StopType) (err error)
- func (m *Manager) StartPlugin(name, configuration string, orchestrationDir string, ...) (err error)
- func (m *Manager) StopPlugin(name string, cancelFlag task.CancelFlag) (err error)
- type Mock
- func (m *Mock) EnsurePluginRegistered(name string, plugin managerContracts.Plugin) (err error)
- func (m *Mock) GetRegisteredPlugins() map[string]managerContracts.Plugin
- func (m *Mock) ModuleExecute(context context.T) (err error)
- func (m *Mock) ModuleName() string
- func (m *Mock) ModuleRequestStop(stopType contracts.StopType) (err error)
- func (m *Mock) StartPlugin(name, configuration, orchestrationDir string, cancelFlag task.CancelFlag) (err error)
- func (m *Mock) StopPlugin(name string, cancelFlag task.CancelFlag) (err error)
- type T
Constants ¶
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" //number of long running workers NumberOfLongRunningPluginWorkers = 5 //number of cancel workers NumberOfCancelWorkers = 5 //poll frequency for managing lifecycle of long running plugins PollFrequencyMinutes = 15 //hardStopTimeout is the time before the manager will be shutdown during a hardstop = 4 seconds HardStopTimeout = 4 * time.Second //softStopTimeout is the time before the manager will be shutdown during a softstop = 20 seconds SoftStopTimeout = 20 * time.Second )
const CloudWatchId = "aws:cloudWatch"
CloudWatchId represents the ID of cloud watch plugin
Variables ¶
This section is empty.
Functions ¶
func EnsureInitialization ¶
EnsureManagerIsInitialized ensures that manager is initialized at least once
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the core module - that manages long running plugins
func GetInstance ¶
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 ¶
Execute starts long running plugin manager
func (*Manager) ModuleRequestStop ¶
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) (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 Mock ¶
Mock stands for a mocked manager.
func NewMockDefault ¶
func NewMockDefault() *Mock
NewMockDefault returns an instance of Mock with default expectations set.
func (*Mock) EnsurePluginRegistered ¶
func (m *Mock) EnsurePluginRegistered(name string, plugin managerContracts.Plugin) (err error)
EnsurePluginRegistered adds a long-running plugin if it is not already in the registry
func (*Mock) GetRegisteredPlugins ¶
func (m *Mock) GetRegisteredPlugins() map[string]managerContracts.Plugin
GetRegisteredPlugins returns a map of all registered long running plugins - return the specified plugin map for testing here
func (*Mock) ModuleExecute ¶
Execute starts long running plugin manager and returns encountered error - returns nil here for testing
func (*Mock) ModuleRequestStop ¶
RequestStop handles the termination of the message processor plugin job and returns encountered error - returns nil here for testing
func (*Mock) StartPlugin ¶
func (m *Mock) StartPlugin(name, configuration, orchestrationDir string, cancelFlag task.CancelFlag) (err error)
StartPlugin starts the given plugin with the given configuration and returns encountered error - returns nil here for testing
func (*Mock) StopPlugin ¶
func (m *Mock) StopPlugin(name string, cancelFlag task.CancelFlag) (err error)
StopPlugin stops a given plugin from executing and returns encountered error - returns nil here for testing
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) (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