sse

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sse implements a streaming Server-Sent Events reader shared by the Rico and AI Editor agent clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Name    string // value of the "event:" field, if any
	Data    string // "data:" lines joined with "\n"
	Comment bool   // frame contained only ":" comment lines
}

Event is one SSE frame. Comment-only frames (keepalives) are surfaced with Comment set so callers can reset inactivity timers.

type Reader

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

Reader incrementally decodes SSE frames from a stream.

func NewReader

func NewReader(r io.Reader) *Reader

func (*Reader) Next

func (r *Reader) Next() (Event, error)

Next returns the next frame, or io.EOF when the stream ends. Frames with no data and no comment (stray blank lines) are skipped.

Jump to

Keyboard shortcuts

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