testutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSEFrame

type SSEFrame struct {
	ID    string
	Event string
	Data  []byte
}

SSEFrame is one parsed server-sent-event frame collected from a stream body.

func ReadSSEFramesUntil

func ReadSSEFramesUntil(
	body io.ReadCloser,
	timeout time.Duration,
	stop func([]SSEFrame) bool,
) ([]SSEFrame, error)

ReadSSEFramesUntil reads SSE frames from body until stop reports success, the stream ends, or timeout expires. The helper owns body for the duration of the read and closes it on early termination so the scanner goroutine exits.

Jump to

Keyboard shortcuts

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