wsshell

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WSShell

type WSShell struct {
	Conn       *websocket.Conn
	RemoteAddr string
	ConnId     string
	Query      url.Values
	OpenTime   time.Time
	NumPings   int
	LastPing   time.Time
	LastRecv   time.Time
	Header     http.Header

	CloseChan chan bool
	WriteChan chan []byte
	ReadChan  chan []byte
}

func StartWS

func StartWS(w http.ResponseWriter, r *http.Request) (*WSShell, error)

func (*WSShell) IsClosed

func (ws *WSShell) IsClosed() bool

func (*WSShell) NonBlockingWrite

func (ws *WSShell) NonBlockingWrite(data []byte) bool

func (*WSShell) ReadPump

func (ws *WSShell) ReadPump()

func (*WSShell) WriteJson

func (ws *WSShell) WriteJson(val interface{}) error

func (*WSShell) WritePing

func (ws *WSShell) WritePing() error

func (*WSShell) WritePump

func (ws *WSShell) WritePump()

Jump to

Keyboard shortcuts

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