sse

package
v0.3.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ContentEventStream = "text/event-stream"

	// MaxSSETokenSize is the maximum size for SSE data lines (10MB).
	// The default bufio.Scanner buffer of 64KB is insufficient for large payloads
	MaxSSETokenSize = 10 * 1024 * 1024 // 10MB
)

Variables

This section is empty.

Functions

func ParseDataStream

func ParseDataStream(body io.Reader) iter.Seq2[[]byte, error]

Types

type SSEWriter

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

func NewWriter

func NewWriter(w http.ResponseWriter) (*SSEWriter, error)

func (*SSEWriter) WriteData

func (w *SSEWriter) WriteData(ctx context.Context, data []byte) error

func (*SSEWriter) WriteHeaders

func (w *SSEWriter) WriteHeaders()

func (*SSEWriter) WriteKeepAlive

func (w *SSEWriter) WriteKeepAlive(ctx context.Context) error

Jump to

Keyboard shortcuts

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