events

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: GPL-3.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher interface {
	interfaces.Module
	AddEventListener(eventType EventType, listener *EventListener)
	RemoveEventListener(eventType EventType, listener *EventListener)
	RemoveAllEventListener(eventType EventType)
	DispatchEvent(event *Event)
}

func NewDispatcher

func NewDispatcher(ctx context.Context) Dispatcher

type Event

type Event struct {
	Type   EventType
	Object interface{}
}

func NewEvent

func NewEvent(eventType EventType, object interface{}) *Event

type EventHandler

type EventHandler func(event *Event)

type EventListener

type EventListener struct {
	Handler EventHandler
}

func NewEventListener

func NewEventListener(handler EventHandler) *EventListener

type EventType

type EventType string

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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