events

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeTo added in v1.6.1

func DecodeTo(data []byte, v interface{}) error

DecodeTo decodes a byte slice of event data into the given interface.

Types

type Bus added in v1.5.4

type Bus struct {
	*system.SinkPool
}

Bus represents an Event Bus.

func NewBus added in v1.5.4

func NewBus() *Bus

NewBus returns a new empty Bus. This is simply a nicer wrapper around the system.SinkPool implementation that allows for more simplistic usage within the codebase.

All of the events emitted out of this bus are byte slices that can be decoded back into an events.Event interface.

func (*Bus) Publish added in v1.5.4

func (b *Bus) Publish(topic string, data interface{})

Publish publishes a message to the Bus.

type Event

type Event struct {
	Topic string
	Data  interface{}
}

Event represents an Event sent over a Bus.

func MustDecode added in v1.6.1

func MustDecode(data []byte) (e Event)

MustDecode decodes the event byte slice back into an events.Event struct or panics if an error is encountered during this process.

Jump to

Keyboard shortcuts

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