event

package
v0.0.0-...-15b0c83 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 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 Bus

type Bus interface {
	BusSubscriber
	BusPublisher
}

Bus englobes global (subscribe, publish) bus behavior

var (
	BusDefault Bus = evbus.New()
)

type BusPublisher

type BusPublisher interface {
	Publish(topic string, args ...interface{})
}

BusPublisher defines publishing-related bus behavior

type BusSubscriber

type BusSubscriber interface {
	Subscribe(topic string, fn interface{}) error
	SubscribeAsync(topic string, fn interface{}, transactional bool) error
	Unsubscribe(topic string, handler interface{}) error
}

BusSubscriber defines subscription-related bus behavior

type EventContext

type EventContext struct {
	context.Context
	Publisher interface{}
	Param     interface{}
}

type EventHandler

type EventHandler func(ctx EventContext)

type Subscriber

type Subscriber struct {
	Topic string
	Fn    EventHandler
}

Jump to

Keyboard shortcuts

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