sse

package
v0.0.0-...-00d5bf9 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrBufferFull = oerrs.String("buffer full")
)
View Source
const (
	ErrNoListener = oerrs.String("no registered listener")
)

Variables

This section is empty.

Functions

func LastEventID

func LastEventID(ctx *gserv.Context) string

Types

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) Handle

func (r *Router) Handle(id string, bufSize int, ctx *gserv.Context) (_ gserv.Response)

Process will take over the current connection and process events

func (*Router) Send

func (r *Router) Send(id, eventID, event string, data any) (err error)

type Stream

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

func NewStream

func NewStream(ctx *gserv.Context, bufSize int) (lastEventID string, ss *Stream, err error)

func (*Stream) Ping

func (ss *Stream) Ping() error

func (*Stream) Retry

func (ss *Stream) Retry(ms int) (err error)

func (*Stream) SendAll

func (ss *Stream) SendAll(id, evt string, msg any) error

func (*Stream) SendData

func (ss *Stream) SendData(data any) error

Jump to

Keyboard shortcuts

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