sse

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sse provides Server-Sent Events (SSE) processing utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process[T any](body io.Reader, er error, lenient bool) (iter.Seq[T], func() error)

Process reads and processes Server-Sent Events (SSE) from the provided reader.

It parses the SSE format and decodes JSON messages into values of type T. The decoded values are sent to the iterator.

If decoding into T fails, it tries to decode into er, which the error code path. If this succeeds, the error is returned and the iterator is stopped.

https://developer.mozilla.org/en-US/docs/Web/API/Server-sent%5Fevents/Using%5Fserver-sent%5Fevents

Types

This section is empty.

Jump to

Keyboard shortcuts

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