events

package
v1.0.7-beta Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewWebSocketBuilder

func CreateNewWebSocketBuilder(path string, websocketConnectionHandler func(conn *websocket.Conn) error,
) middleware.Builder

func CreateWebSocketEventHandler

func CreateWebSocketEventHandler(hub EventHub) func(conn *websocket.Conn) error

func Echo

func Echo(w http.ResponseWriter, r *http.Request)

func WebSocketEchoHandler

func WebSocketEchoHandler(ws *websocket.Conn) error

Types

type Event

type Event struct {
	Message string
}

type EventHub

type EventHub interface {
	EmitEvent(event *Event)
	FlushEvents()
	ShutdownEventHub()
	Run()
	UnregisterConnection(ws *websocket.Conn)
	RegisterConnection(ws *websocket.Conn)
}

func NewLoggingEventHub

func NewLoggingEventHub(logger *zerolog.Logger) EventHub

func NewWebSocketEventHub

func NewWebSocketEventHub() EventHub

Jump to

Keyboard shortcuts

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