im_server

package
v0.0.0-...-fb2315c Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitImServer

func InitImServer()

Types

type Client

type Client struct {
	ID   uint64
	Conn *websocket.Conn

	CloseChan chan struct{}
	Closed    bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient(id uint64, conn *websocket.Conn) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) ReadLoop

func (c *Client) ReadLoop()

func (*Client) ReadMsg

func (c *Client) ReadMsg() (data []byte, err error)

func (*Client) Run

func (c *Client) Run()

func (*Client) WriteLoop

func (c *Client) WriteLoop()

func (*Client) WriteMsg

func (c *Client) WriteMsg(data []byte) error

type IMServer

type IMServer struct {
	Clients        map[uint64]*Client
	RegisterChan   chan *Client
	UnRegisterChan chan *Client
}
var ImServer *IMServer

func NewImServer

func NewImServer() *IMServer

func (*IMServer) GetClient

func (im *IMServer) GetClient(id uint64) *Client

func (*IMServer) Start

func (im *IMServer) Start()

func (*IMServer) Stop

func (im *IMServer) Stop()

Jump to

Keyboard shortcuts

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