sse

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event map[string]string

type SSE

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

func NewSSE

func NewSSE(r io.Reader) *SSE

func (*SSE) AutoFlush added in v0.0.19

func (sse *SSE) AutoFlush(af bool)

AutoFlush allows changing the auto-flush behavior. Default is to auto-flush after each event.

func (*SSE) KeepAlive added in v0.0.16

func (sse *SSE) KeepAlive(w io.Writer) error

func (*SSE) Read added in v0.0.16

func (sse *SSE) Read() (Event, bool)

Read will return an event, which may be empty if nothing but a keep-alive was received thus far. The boolean flag indicates EOF. If true, no more reads should be performed on this SSE.

func (*SSE) Write added in v0.0.16

func (sse *SSE) Write(w io.Writer, event Event) error

Jump to

Keyboard shortcuts

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