sse

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

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

Stream writes SSE frames and bounds each client write.

func New

func New(w http.ResponseWriter) *Stream

New constructs a Stream for w.

func (*Stream) BeginWrite

func (s *Stream) BeginWrite() error

BeginWrite starts a bounded write sequence. Call Flush after its frames.

func (*Stream) ClearWriteDeadline

func (s *Stream) ClearWriteDeadline() error

ClearWriteDeadline ends a write sequence that failed before Flush.

func (*Stream) Data

func (s *Stream) Data(data []byte) error

Data writes and flushes an SSE data frame.

func (*Stream) Flush

func (s *Stream) Flush() error

Flush delivers pending frames and clears their write deadline.

func (*Stream) KeepAlive

func (s *Stream) KeepAlive() error

KeepAlive writes and flushes an SSE comment heartbeat.

func (*Stream) Writef

func (s *Stream) Writef(format string, args ...any) error

Writef writes an SSE frame. Call Flush to deliver buffered frames.

Jump to

Keyboard shortcuts

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