sse

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

func NewHub

func NewHub(ps core.PubSub) *Hub

func (*Hub) Publish

func (h *Hub) Publish(topic string, data string)

func (*Hub) PublishHTML

func (h *Hub) PublishHTML(topic string, component templ.Component) error

func (*Hub) PublishHTMLComponent

func (h *Hub) PublishHTMLComponent(topic string, component templ.Component) error

func (*Hub) Subscribe

func (h *Hub) Subscribe(topic string) (chan string, func())

type Stream

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

func New

func New(c echo.Context) (*Stream, error)

func (*Stream) Proxy

func (s *Stream) Proxy(ch <-chan string) error

Proxy forwards messages from the channel to the stream until the channel is closed or the client disconnects.

func (*Stream) Send

func (s *Stream) Send(event, data string) error

func (*Stream) SendMessage

func (s *Stream) SendMessage(data string) error

func (*Stream) Wait

func (s *Stream) Wait()

Jump to

Keyboard shortcuts

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