stream

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package stream defines the multiplexed client stream: one connection that carries every live channel the caller asked for.

Browsers cap concurrent HTTP/1.1 requests per origin at six, and every long-lived stream permanently consumes one of them. Multiplexing keeps that budget for ordinary requests, and gives the client a single reconnect and heartbeat to reason about instead of one per feature.

Index

Constants

View Source
const (
	ChannelEnvironments = "environments"
	ChannelDashboard    = "dashboard"
	ChannelActivities   = "activities"
)

Channel names a subscribable feed. Callers request channels explicitly because they differ enormously in cost: environments is one local query, while dashboard proxies a request to every remote agent on every tick.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// Channel identifies which feed produced this event. Empty on a heartbeat.
	//
	// Required: false
	Channel string `json:"channel,omitempty"`

	// Type is set to "heartbeat" for connection keepalives; otherwise the
	// per-channel payload carries its own type.
	//
	// Required: false
	Type string `json:"type,omitempty"`

	// Dashboard carries a ChannelDashboard payload.
	//
	// Required: false
	Dashboard *dashboardtypes.StreamEvent `json:"dashboard,omitempty"`

	// Activity carries a ChannelActivities payload.
	//
	// Required: false
	Activity *activitytypes.StreamEvent `json:"activity,omitempty"`

	// Environment carries a ChannelEnvironments payload.
	//
	// Required: false
	Environment *environmenttypes.StreamEvent `json:"environment,omitempty"`

	// Timestamp is when the envelope was produced.
	//
	// Required: true
	Timestamp time.Time `json:"timestamp"`
}

Event is one line of the multiplexed stream. Exactly one payload is set, and each payload keeps its own channel's event type rather than being flattened here, so a channel can add a field without this envelope changing.

Jump to

Keyboard shortcuts

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