websockets

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Send      chan []byte
	SendQueue chan []byte
	// contains filtered or unexported fields
}

func (*Connection) Run

func (c *Connection) Run()

func (*Connection) SendError

func (c *Connection) SendError(target string, msg string)

func (*Connection) SendPacket

func (c *Connection) SendPacket(data map[string]interface{})

type ReceiveMessage

type ReceiveMessage struct {
	Message    []byte
	Connection *Connection
}

type Websocket

type Websocket struct {
	ReceiveMessages chan ReceiveMessage
	NewConnection   chan ReceiveMessage
	// contains filtered or unexported fields
}

func New

func New() *Websocket

func (*Websocket) Broadcast

func (s *Websocket) Broadcast(pkt map[string]interface{})

func (*Websocket) ConnectionCount

func (s *Websocket) ConnectionCount() int

func (*Websocket) Run

func (h *Websocket) Run()

func (*Websocket) Serve

func (s *Websocket) Serve(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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