stream

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package stream is the AppEngine live event socket (docs/DESIGN.md §3.7, §1.1 deviation; ROADMAP §8.2 file 7.9): a WebSocket (with an SSE fallback) at /astrate/v1/{realm}/socket fed by the engine's in-process fan-out bus. Subscribers receive the realm's committed data and device lifecycle events as JSON; an a_ch JWT guards the endpoint, and device_id/interface query parameters narrow the room.

This is a deliberate departure from upstream Astarte's Phoenix Channels wire protocol (docs/DESIGN.md §1.1): the surface is a plain WebSocket/SSE, not phx_join frames, so it is documented as Astrate-specific.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is the live-socket HTTP surface, guarded by an a_ch realm JWT.

func NewAPI

func NewAPI(bus Bus, mw *auth.Middleware) *API

NewAPI wires the socket to the engine bus and the a_ch middleware.

func (*API) Mount

func (a *API) Mount(mux *http.ServeMux)

Mount registers the socket route on mux.

type Bus

type Bus interface {
	Subscribe(realm string, f engstream.Filter, buffer int) (<-chan engstream.Event, func())
}

Bus is the subset of the engine fan-out bus the socket consumes.

Jump to

Keyboard shortcuts

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