events

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubscribeAsync

func SubscribeAsync[T Event](b *Bus, sub func(T))

func SubscribeSync

func SubscribeSync[T Event](b *Bus, sub func(T) error)

Types

type Bus

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

func NewBus

func NewBus(logger log.Logger) *Bus

func (*Bus) Publish

func (b *Bus) Publish(event Event) error

type DidCommitBlock

type DidCommitBlock struct {
	Init  bool
	Index uint64
	Time  time.Time
	Major uint64
}

func (DidCommitBlock) IsEvent

func (DidCommitBlock) IsEvent()

type DidSaveSnapshot

type DidSaveSnapshot struct {
	MinorIndex uint64
}

func (DidSaveSnapshot) IsEvent

func (DidSaveSnapshot) IsEvent()

type Event

type Event interface {
	IsEvent()
}

type FatalError

type FatalError struct {
	Err error
}

func (FatalError) Error

func (e FatalError) Error() string

func (FatalError) IsEvent

func (FatalError) IsEvent()

func (FatalError) Unwrap

func (e FatalError) Unwrap() error

type WillChangeGlobals

type WillChangeGlobals struct {
	New, Old *core.GlobalValues
}

func (WillChangeGlobals) IsEvent

func (WillChangeGlobals) IsEvent()

Jump to

Keyboard shortcuts

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