websocket

package
v0.0.0-...-d451a21 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastInfo

type BroadcastInfo struct {
	// contains filtered or unexported fields
}

type Client

type Client struct {
	Send   chan interface{}
	UserId int
	// contains filtered or unexported fields
}

func NewClient

func NewClient(wss *WebSocketService, conn *websocket.Conn, userId int) *Client

func (*Client) InitReadHandler

func (client *Client) InitReadHandler()

func (*Client) InitWriteHandler

func (client *Client) InitWriteHandler()

type IWebSocketService

type IWebSocketService interface {
	InitConnection(*websocket.Conn, interface{})
	Broadcast(*BroadcastInfo)
}

func NewWebSocketService

func NewWebSocketService() IWebSocketService

type Message

type Message struct {
	Id    int    `json:"id"`
	Event string `json:"event"`
}

type WebSocketService

type WebSocketService struct {
	// contains filtered or unexported fields
}

func (*WebSocketService) Broadcast

func (service *WebSocketService) Broadcast(broadcastInfo *BroadcastInfo)

func (*WebSocketService) InitConnection

func (service *WebSocketService) InitConnection(
	connection *websocket.Conn,
	userData interface{},
)

Jump to

Keyboard shortcuts

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