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: 0

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