eventbus

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus interface {
	Publish(topic string, cameraID string, data any)
	Stop()
}

func New

func New(cfg config.EventsConfig, numWorkers int) Bus

New создает новую шину событий и запускает воркеры.

type Event

type Event struct {
	ID          string `json:"id"`
	TimestampMs int64  `json:"timestamp_ms"`
	Topic       string `json:"topic"`
	CameraID    string `json:"camera_id,omitempty"`
	Data        any    `json:"data,omitempty"`
}

Event представляет единицу события в системе

type EventBus

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

func (*EventBus) Publish

func (b *EventBus) Publish(topic string, cameraID string, data any)

func (*EventBus) Stop

func (b *EventBus) Stop()

Jump to

Keyboard shortcuts

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