event

package
v0.0.0-...-f7d1ac2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler = func(ctx context.Context, ev interface{}) error

type PubSub

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

PubSub implements a simple event broker which allows to send event across the application.

func NewPubSub

func NewPubSub(log logrus.FieldLogger) *PubSub

func (*PubSub) Publish

func (b *PubSub) Publish(ctx context.Context, ev interface{})

func (*PubSub) Subscribe

func (b *PubSub) Subscribe(evType interface{}, evHandler Handler)

type Publisher

type Publisher interface {
	Publish(ctx context.Context, event interface{})
}

type Subscriber

type Subscriber interface {
	Subscribe(evType interface{}, evHandler Handler)
}

Jump to

Keyboard shortcuts

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