websocket

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base() string

Base returns the base url, removing any trailing slash.

func BaseWs

func BaseWs() string

BaseWs is the same as Base but transforms http -> ws and https -> wss.

Types

type Actions

type Actions struct {
	app.Context
}

func Action

func Action(ctx app.Context) *Actions

func (*Actions) HandleAction

func (ac *Actions) HandleAction(m model.WebSocketMessage, handler MessageHandler)

func (*Actions) Write

func (ac *Actions) Write(message model.WebSocketMessage)

type MessageHandler added in v0.10.4

type MessageHandler interface {
	OnWebsocketMessage(ctx app.Context, message model.WebSocketMessage)
}

type WebSocket

type WebSocket struct {
	app.Compo
	goapp.Logging
	// contains filtered or unexported fields
}

func (*WebSocket) OnMount

func (w *WebSocket) OnMount(ctx app.Context)

func (*WebSocket) Render

func (w *WebSocket) Render() app.UI

Jump to

Keyboard shortcuts

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