util

package
v1.6.1-0...-514ec83 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WSChannel

type WSChannel struct {
	Sid     string          // wide session id
	Conn    *websocket.Conn // websocket connection
	Request *http.Request   // HTTP request related
	Time    time.Time       // the latest use time
}

WSChannel represents a WebSocket channel.

func (*WSChannel) Close

func (c *WSChannel) Close()

Close closed the channel.

func (*WSChannel) ReadJSON

func (c *WSChannel) ReadJSON(v interface{}) (ret error)

ReadJSON reads the next JSON-encoded message from the channel and stores it in the value pointed to by v.

func (*WSChannel) Refresh

func (c *WSChannel) Refresh()

Refresh refreshes the channel by updating its use time.

func (*WSChannel) WriteJSON

func (c *WSChannel) WriteJSON(v interface{}) (ret error)

WriteJSON writes the JSON encoding of v to the channel.

Jump to

Keyboard shortcuts

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