eventbus

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventInvalidation = "invalidation"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

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

func NewEventBus

func NewEventBus(nodeID string, dsn string, log *zap.SugaredLogger) *EventBus

func (*EventBus) Start

func (bus *EventBus) Start() error

func (*EventBus) Stop

func (bus *EventBus) Stop() error

func (*EventBus) Subscribe

func (bus *EventBus) Subscribe(channel string, fn func(data []byte))

type EventPayload

type EventPayload struct {
	Event string          `json:"event"`
	Data  json.RawMessage `json:"data"`
	Time  int64           `json:"time"`
	Node  string          `json:"node"`
}

Jump to

Keyboard shortcuts

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