sse

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanEvents

func ScanEvents(r io.Reader) iter.Seq2[Event, error]

ScanEvents iterates SSE events in the given io.Reader. The iterated error is terminal: if encountered, the stream is corrupt or broken and should no longer be used.

Types

type Event

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

An Event is a server-sent event.

See https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#fields.

func (Event) Data

func (e Event) Data() []byte

Data returns the data of the event.

func (Event) Empty

func (e Event) Empty() bool

Empty returns true if the Event is empty.

func (Event) Id

func (e Event) Id() string

Id returns the id of the event.

func (Event) Name

func (e Event) Name() string

Name returns the name of the event.

func (Event) Retry

func (e Event) Retry() string

Retry returns the retry of the event.

Jump to

Keyboard shortcuts

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