hooks

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxHooksCount int = 10

maximum hooks allowed

Variables

View Source
var ErrorExecutingHooks error = errors.New("failed executing hooks")

error raised when executing an hook returns an error

View Source
var ErrorMaxHooks error = errors.New("maximum hooks allowed error")

error raised when attempting to add a new hook when the maximum amount of hooks would be exceeded

View Source
var ErrorRoutineModeDisabled error = errors.New("routine mode is disabled error")

error raised when attempting to start the worker routine when not in routine mode

Functions

This section is empty.

Types

type Hook

type Hook func(message *Messages.RouterMessage) error

type HookChannel

type HookChannel chan *Messages.RouterMessage

type HookExecutor

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

func CreateHookExecutor

func CreateHookExecutor(routineMode bool) *HookExecutor

creates new hook executor

func (*HookExecutor) AddHook

func (hookExecutor *HookExecutor) AddHook(hook Hook) error

add an hook to the executor processing queue returns ErrorMaxHooks when maximum hooks count is exceeded

func (*HookExecutor) Count

func (hookExecutor *HookExecutor) Count() int

returns the count of hooks in the processing queue

func (*HookExecutor) Execute

func (hookExecutor *HookExecutor) Execute(message *Messages.RouterMessage) (*Hook, error)

hooks queue executor executes all queue with passed message

func (*HookExecutor) FailedCount

func (hookExecutor *HookExecutor) FailedCount() int64

returns the number of times hooks failed executing

func (*HookExecutor) GetInputChannel

func (hookExecutor *HookExecutor) GetInputChannel() chan *Messages.RouterMessage

returns the messages input channel witch is used by the hook executor

func (*HookExecutor) StartExecutor

func (hookExecutor *HookExecutor) StartExecutor() error

start the hook executor routine return ErrorRoutineModeDisabled if routine mode is disabled

func (*HookExecutor) Stop

func (hookExecutor *HookExecutor) Stop() error

stops the executor routine

Jump to

Keyboard shortcuts

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