dispatcher

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dispatcher handles bout events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher interface {
	Dispatch(event *Event) error
	DispatcherType() enum.DispatcherTypeID
	DispatchTypes() []enum.EventTypeID
}

type Event

type Event struct {
	Type   enum.EventTypeID
	Object interface{}
}

func NewEvent

func NewEvent(typ enum.EventTypeID, object interface{}) *Event

type Manager

type Manager struct {
	// contains filtered or unexported fields
}
var SharedManager *Manager

func NewManager

func NewManager(log *logrus.Logger) *Manager

func (*Manager) Dispatch

func (m *Manager) Dispatch(e *Event) error

func (*Manager) Dispatcher

func (m *Manager) Dispatcher(typ enum.DispatcherTypeID) (Dispatcher, bool)

func (*Manager) Register

func (m *Manager) Register(ds ...Dispatcher)

func (*Manager) RegisterFunc

func (m *Manager) RegisterFunc(typ enum.EventTypeID, d Dispatcher)

Jump to

Keyboard shortcuts

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