eventstream

package
v0.0.0-...-f2b9f5f Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventStream

func NewEventStream(gctx global.Context, r *http.Request) (client.Connection, error)

func SetEventStreamHeaders

func SetEventStreamHeaders(w http.ResponseWriter)

Types

type EventStream

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

func (*EventStream) Actor

func (*EventStream) Actor() *structures.User

func (*EventStream) Buffer

func (es *EventStream) Buffer() client.EventBuffer

Buffer implements client.Connection

func (*EventStream) Cache

func (es *EventStream) Cache() client.Cache

func (*EventStream) Context

func (es *EventStream) Context() context.Context

Context implements Connection

func (*EventStream) Destroy

func (es *EventStream) Destroy()

func (*EventStream) Events

func (es *EventStream) Events() *client.EventMap

func (*EventStream) Greet

func (es *EventStream) Greet(gctx global.Context) error

func (*EventStream) Handler

func (es *EventStream) Handler() client.Handler

Handler implements client.Connection

func (*EventStream) OnClose

func (es *EventStream) OnClose() <-chan struct{}

Ready implements client.Connection

func (*EventStream) OnReady

func (es *EventStream) OnReady() <-chan struct{}

Ready implements client.Connection

func (*EventStream) Read

func (es *EventStream) Read(gctx global.Context)

func (*EventStream) SendAck

func (es *EventStream) SendAck(cmd events.Opcode, data json.RawMessage) error

SendAck implements client.Connection

func (*EventStream) SendClose

func (es *EventStream) SendClose(code events.CloseCode, after time.Duration)

func (*EventStream) SendError

func (es *EventStream) SendError(txt string, fields map[string]any)

func (*EventStream) SendHeartbeat

func (es *EventStream) SendHeartbeat() error

func (*EventStream) SessionID

func (es *EventStream) SessionID() string

func (*EventStream) SetReady

func (es *EventStream) SetReady()

func (*EventStream) SetWriter

func (es *EventStream) SetWriter(w *bufio.Writer, f http.Flusher)

SetWriter implements Connection

func (*EventStream) Transport

func (es *EventStream) Transport() client.Transport

func (*EventStream) Write

func (es *EventStream) Write(msg events.Message[json.RawMessage]) error

Jump to

Keyboard shortcuts

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