event

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID          string         `json:"id"`
	Source      string         `json:"source"`
	SpecVersion string         `json:"specversion"`
	Type        string         `json:"type"`
	Data        map[string]any `json:"data"`
	Time        time.Time      `json:"time"`
}

Event represents a generic event

type EventBus

type EventBus interface {
	Publish(ctx context.Context, event Event) error
	Subscribe(eventType string, handler func(ctx context.Context, event Event)) error
	Close() error // Clean up resources
}

EventBus defines the interface for publishing and subscribing to events

var DefaultEventBus EventBus

Jump to

Keyboard shortcuts

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