msgqueue

package
v0.0.0-...-680ee72 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicEventMapper

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

func (*DynamicEventMapper) MapEvent

func (e *DynamicEventMapper) MapEvent(eventName string, serialized interface{}) (Event, error)

func (*DynamicEventMapper) RegisterMapping

func (e *DynamicEventMapper) RegisterMapping(eventType reflect.Type) error

type Event

type Event interface {
	EventName() string
}

Interface definition for events that are emitted using an EventEmitter Currently, the only requirement is that events are self-describing so that event emitter and listeners can infer an event's name.

type EventEmitter

type EventEmitter interface {
	Emit(e Event) error
}

EventEmitter describes an interface for a class that emits events

type EventListener

type EventListener interface {
	Listen(events ...string) (<-chan Event, <-chan error, error)
	Mapper() EventMapper
}

EventListener describes an interface for a class that can listen to events.

type EventMapper

type EventMapper interface {
	MapEvent(string, interface{}) (Event, error)
}

func NewDynamicEventMapper

func NewDynamicEventMapper() EventMapper

func NewEventMapper

func NewEventMapper() EventMapper

type StaticEventMapper

type StaticEventMapper struct{}

func (*StaticEventMapper) MapEvent

func (e *StaticEventMapper) MapEvent(eventName string, serialized interface{}) (Event, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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