hot

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID    string // id (optional)
	Type  string // event type (optional)
	Data  []byte // data
	Retry int    // retry (optional)
}

https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation

func (*Event) Format

func (e *Event) Format() *bytes.Buffer

type Server

type Server struct {
	Now func() time.Time // Used for testing
	// contains filtered or unexported fields
}

func New

func New(ps pubsub.Subscriber) *Server

New server-sent event (SSE) server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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