events

package
v0.0.0-...-ca54044 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	GetName() string
	GetDateTime() time.Time
	GetPayload() interface{}
	SetPayload(payload interface{})
}

type EventDispatcher

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

func NewEventDispatcher

func NewEventDispatcher() *EventDispatcher

func (*EventDispatcher) Clear

func (ed *EventDispatcher) Clear()

func (*EventDispatcher) Dispatch

func (ed *EventDispatcher) Dispatch(event Event)

func (*EventDispatcher) Has

func (ed *EventDispatcher) Has(name string, handler EventHandler) bool

func (*EventDispatcher) Register

func (ed *EventDispatcher) Register(name string, handler EventHandler) error

func (*EventDispatcher) Remove

func (ed *EventDispatcher) Remove(name string, handler EventHandler)

type EventHandler

type EventHandler interface {
	Handle(event Event, wg *sync.WaitGroup)
}

Jump to

Keyboard shortcuts

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