ws

package
v0.0.0-...-44a0b5b Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerHub = NewHub()

Functions

func BroadcastMsg

func BroadcastMsg(msg Msg)

func Init

func Init()

func ServeWs

func ServeWs(hub *Hub, w http.ResponseWriter, r *http.Request)

Types

type Client

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

type Hub

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

func NewHub

func NewHub() *Hub

func (*Hub) Run

func (h *Hub) Run()

type Msg

type Msg struct {
	Type MsgType     `json:"type"`
	Data interface{} `json:"data"`
}

type MsgType

type MsgType string

Jump to

Keyboard shortcuts

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