bus

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: AGPL-3.0 Imports: 6 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHandler

func AddHandler(handler HandlerFunc)

func AddListener

func AddListener(handler HandlerFunc)

func Dispatch

func Dispatch(ctx context.Context, msgs ...Msg) error

func MustDispatch

func MustDispatch(ctx context.Context, msgs ...Msg)

func Publish

func Publish(ctx context.Context, msgs ...Msg)

func Register

func Register(svc Service)

func Reset

func Reset()

Types

type HandlerFunc

type HandlerFunc interface{}

type Msg

type Msg interface{}

type Service

type Service interface {
	Name() string
	Category() string
	Enabled() bool
	Init()
}

func Init

func Init(forcedServices ...Service) []Service

Initializes the bus services that have been registered via bus.Register Services that set via Init(...services) are always registered (regardless of Enabled() function) / and have preference over services registered from bus.Register

Jump to

Keyboard shortcuts

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