eventbus

package
v0.9.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCRUD        = "crud"
	EventEventFanout = "event.fanout"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus added in v0.6.0

type Bus interface {
	ClusteringBroadcast(event string, data interface{}) error
	ClusteringSubscribe(channel string, fn func(data []byte))
	Broadcast(channel string, data interface{})
	Subscribe(channel string, cb Callback)
}

type Callback added in v0.6.0

type Callback func(data interface{})

type CrudData added in v0.5.0

type CrudData struct {
	Entity   string          `json:"entity"`
	ID       string          `json:"id"`
	WID      string          `json:"wid"`
	CacheKey string          `json:"cache_key"`
	Data     json.RawMessage `json:"data"`
}

type EventBus

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

func NewEventBus

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

func (*EventBus) Broadcast added in v0.6.0

func (bus *EventBus) Broadcast(channel string, data interface{})

func (*EventBus) ClusteringBroadcast added in v0.6.0

func (bus *EventBus) ClusteringBroadcast(channel string, data interface{}) error

func (*EventBus) ClusteringSubscribe added in v0.6.0

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

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, cb Callback)

type EventFanoutData added in v0.8.0

type EventFanoutData struct {
	EventId    string   `json:"event_id"`
	AttemptIds []string `json:"attempt_ids"`
}

type Message added in v0.6.0

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

Message clustering message

Jump to

Keyboard shortcuts

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