Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLineTooLarge = errors.New("sse: line too large") ErrEventTooLarge = errors.New("sse: event too large") )
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner reads SSE events from an io.Reader.
§17.1 Zero-copy optimization: uses ReadSlice for zero-alloc line reads, accumulates data in a reusable byte buffer, and defers string conversion to Event()/UnsafeEvent() access time.
func NewScanner ¶
NewScanner creates a scanner with default resource limits.
func (*Scanner) UnsafeEvent ¶
UnsafeEvent returns the event with zero-copy Data backed by internal buffers. The returned Event.Data is only valid until the next call to Next(). Use for hot paths where the caller processes data immediately.
Click to show internal directories.
Click to hide internal directories.