sse

package module
v0.0.0-...-7375ce0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

sse

A simple sse for server.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteEvent

func WriteEvent(writer io.Writer, event Event) error

WriteEvent encodes an event to the sse format, and writes it to the writer.

Types

type Event

type Event struct {
	ID    []byte
	Data  []byte
	Event []byte
	Retry []byte
}

Event holds all of the event source fields

type Upgrader

type Upgrader struct {
}

Upgrader specifies parameters for upgrading an HTTP connection to a SSE connection.

It is safe to call Upgrader's methods concurrently.

func (*Upgrader) Upgrade

func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request) (http.Flusher, error)

Directories

Path Synopsis
examples
echo command

Jump to

Keyboard shortcuts

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