events

package
v0.0.0-...-25dc0e1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	HandleEvent(context.Context, EventMessage)
}

type EventManager

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

func NewEventManager

func NewEventManager() *EventManager

func (*EventManager) Publish

func (e *EventManager) Publish(emsg EventMessage)

func (*EventManager) StartListening

func (e *EventManager) StartListening(ctx context.Context, handler EventHandler, serviceName string, onSubscribe func())

func (*EventManager) Subscribe

func (e *EventManager) Subscribe(name string) (uuid.UUID, <-chan EventMessage)

func (*EventManager) Unsubscribe

func (e *EventManager) Unsubscribe(id uuid.UUID, name string)

type EventMessage

type EventMessage struct {
	Type    string
	Payload interface{}
}

Jump to

Keyboard shortcuts

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