server

package
v0.0.0-...-20673c3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hub = &ClientGroup{
	clients:    make(map[*Client]bool),
	register:   make(chan *Client),
	unregister: make(chan *Client),
	broadcast:  make(chan []byte),
}

Functions

func WsServer

func WsServer(c *gin.Context)

Types

type Client

type Client struct {
	Socket  *websocket.Conn
	Send    chan []byte
	Message *model.Message
}

单个socket客户端属性

func (*Client) Reader

func (c *Client) Reader()

func (*Client) Writer

func (c *Client) Writer()

type ClientGroup

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

func (*ClientGroup) Run

func (h *ClientGroup) Run()

Jump to

Keyboard shortcuts

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