event

package
v0.0.0-...-c7f360f Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

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

func NewEventBus

func NewEventBus() *EventBus

func (*EventBus) AddHandler

func (eb *EventBus) AddHandler(name string, key string, f t.EventHandlerFcn)

AddHandler adds a new event handler to the event bus.

Parameters: - name: the name of the event. - key: the key associated with the event handler function. - f: the event handler function.

Returns: None.

func (*EventBus) Invoke

func (eb *EventBus) Invoke(name string, e t.Event)

Invoke sends an event to all registered handlers for the given event name.

Parameters: - name: the name of the event. - e: the event to be sent.

Returns: None.

func (*EventBus) RemoveHandler

func (eb *EventBus) RemoveHandler(name string, key string)

RemoveHandler removes an event handler from the event bus.

Parameters: - name: the name of the event. - key: the key associated with the event handler function.

Returns: None.

type EventOpts

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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