websocket

package
v0.0.0-...-12eb309 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Upgrade

func Upgrade(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)

upgrade connection to a WebSocket connection

Types

type Client

type Client struct {
	ID       string
	RoomID   string
	Modality Modality
	Conn     *websocket.Conn
	Pool     *Pool
}

func (*Client) Read

func (c *Client) Read()

type Message

type Message struct {
	Type int
	Body string
}

type Modality

type Modality string
const (
	IE     Modality = "IE"
	Fluoro Modality = "Fluoro"
	XRAY   Modality = "XRAY"
	CT     Modality = "CT"
	IR     Modality = "IR"
	MRI    Modality = "MRI"
	US     Modality = "US"
	Dexa   Modality = "Dexa"
	NucMed Modality = "NucMed"
)

func ParseModality

func ParseModality(modality string) Modality

type Pool

type Pool struct {
	Register   chan *Client
	Unregister chan *Client
	Clients    map[*Client]bool
	Broadcast  chan Message
}

func NewPool

func NewPool() *Pool

func (*Pool) Start

func (pool *Pool) Start()

Jump to

Keyboard shortcuts

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