manager

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityHook

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

EntityHook satisfies the type for the entity tree system.

func (EntityHook) Name

func (h EntityHook) Name() string

Name returns the dynamically generated name based on which plugin action this hook will invoke.

func (EntityHook) Priority

func (h EntityHook) Priority() int

Priority looks up the hook priority from the action it is performing.

func (EntityHook) Run

func (h EntityHook) Run(e, de *pb.Entity) error

Run invokes each registered plugin in a non-deterministic order. The only order that is gauranteed by this interface is that the actions will be called in the same place in the chain each time.

type GroupHook

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

GroupHook satisfies the type for the group tree system.

func (GroupHook) Name

func (h GroupHook) Name() string

Name returns the dynamically generated name based on which plugin action this hook will invoke.

func (GroupHook) Priority

func (h GroupHook) Priority() int

Priority looks up the hook priority from the action it is performing.

func (GroupHook) Run

func (h GroupHook) Run(g, dg *pb.Group) error

Run invokes each registered plugin in a non-deterministic order. The only order that is gauranteed by this interface is that the actions will be called in the same place in the chain each time.

type Manager

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

Manager is a mechanism to keep track of all plugins and handle the integration with the tree.

func New

func New() (Manager, error)

New returns a new manager instance

func (*Manager) ConfigureEntityChains

func (m *Manager) ConfigureEntityChains(h hookInserter)

ConfigureEntityChains is called with a reference to a hookInserter which will insert the named hook into the named chain.

func (*Manager) ConfigureGroupChains

func (m *Manager) ConfigureGroupChains(h hookInserter)

ConfigureGroupChains is called with a reference to a hookInserter which will insert the named hook into the named chain.

func (*Manager) InvokeEntityProcessing

func (m *Manager) InvokeEntityProcessing(opts common.PluginOpts) (common.PluginResult, error)

InvokeEntityProcessing calls ProcessEntity in every plugin.

func (*Manager) InvokeGroupProcessing

func (m *Manager) InvokeGroupProcessing(opts common.PluginOpts) (common.PluginResult, error)

InvokeGroupProcessing calls ProcessGroup in every plugin.

func (*Manager) LoadPlugins

func (m *Manager) LoadPlugins()

LoadPlugins loads all plugins either directly from a dynamic discovery, or from a statically defined list.

func (*Manager) RegisterEntityHooks

func (m *Manager) RegisterEntityHooks()

RegisterEntityHooks handles the generation and registration of hooks in the entity subsystem.

func (*Manager) RegisterGroupHooks

func (m *Manager) RegisterGroupHooks()

RegisterGroupHooks handles the generation and registration of hooks in the group subsystem.

func (*Manager) Shutdown

func (m *Manager) Shutdown()

Shutdown calls shutdown in each plugin and should be called during server shutdown to prevent leaking processes.

Jump to

Keyboard shortcuts

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