Documentation
¶
Index ¶
- type Event
- type Hub
- func (h *Hub) ConfigureStream(topic string, cfg StreamConfig)
- func (h *Hub) GetStreamConfig(topic string) (StreamConfig, bool)
- func (h *Hub) Publish(topic string, ev Event)
- func (h *Hub) Shutdown(ctx context.Context)
- func (h *Hub) Stream(ctx context.Context, topic string, buf int, fn func(Event) error) error
- func (h *Hub) Subscribe(topic string, buf int) (chan Event, func())
- func (h *Hub) WaitUntil(topic string, timeout time.Duration) bool
- type StreamConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub is a simple in-memory pub/sub for SSE topics.
func GetDataHub ¶
func GetDataHub() *Hub
GetDataHub returns the SSE hub for data orchestration (SSESink).
func GetInternalHub ¶
func GetInternalHub() *Hub
GetInternalHub returns the SSE hub for internal API notifications.
func (*Hub) ConfigureStream ¶
func (h *Hub) ConfigureStream(topic string, cfg StreamConfig)
ConfigureStream sets the configuration for a specific stream.
func (*Hub) GetStreamConfig ¶
func (h *Hub) GetStreamConfig(topic string) (StreamConfig, bool)
GetStreamConfig returns the configuration for a specific stream.
func (*Hub) Stream ¶
Stream streams events from a topic to the provided callback until context is done.
type StreamConfig ¶
StreamConfig holds security and other settings for an SSE stream.
Click to show internal directories.
Click to hide internal directories.