websocketService

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

*

  • ______ __
  • /\__ _\ /\ \
  • \/_/\ \/ ___ __\ \ \ __ ___ ___ __
  • \ \ \ / ___\ / __ \ \ \ __ / __ \ / _ \ / ___\ / __ \
  • \_\ \__/\ \__//\ __/\ \ \_\ \/\ \_\ \_/\ \/\ \/\ \__//\ __/
  • /\_____\ \____\ \____\\ \____/\ \__/ \_\ \_\ \_\ \____\ \____\
  • \/_____/\/____/\/____/ \/___/ \/__/\/_/\/_/\/_/\/____/\/____/ * *
  • @寒冰
  • www.icezzz.cn
  • hanbin020706@163.com

*

  • ______ __
  • /\__ _\ /\ \
  • \/_/\ \/ ___ __\ \ \ __ ___ ___ __
  • \ \ \ / ___\ / __ \ \ \ __ / __ \ / _ \ / ___\ / __ \
  • \_\ \__/\ \__//\ __/\ \ \_\ \/\ \_\ \_/\ \/\ \/\ \__//\ __/
  • /\_____\ \____\ \____\\ \____/\ \__/ \_\ \_\ \_\ \____\ \____\
  • \/_____/\/____/\/____/ \/___/ \/__/\/_/\/_/\/_/\/____/\/____/ * *
  • @寒冰
  • www.icezzz.cn
  • hanbin020706@163.com

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func (*Connection) Receive

func (u *Connection) Receive() error

Receive reads next message from user's underlying connection. It blocks until full message received.

type Group

type Group struct {
	Hanlder *Handler
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(pool *gopool.Pool) *Group

func (*Group) Register

func (c *Group) Register(conn net.Conn) *Connection

Register registers new connection as a User.

func (*Group) Remove

func (c *Group) Remove(user *Connection)

Remove removes user from chat.

func (*Group) Rename

func (c *Group) Rename(user *Connection, name string) (prev string, ok bool)

Rename renames user.

type Handler

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

func (*Handler) AddHandler

func (h *Handler) AddHandler(messageType uint16, fun RecvHandler)

func (*Handler) Execute

func (h *Handler) Execute(data *MessageData) *MessageData

func (*Handler) Init

func (h *Handler) Init()

type MessageData

type MessageData struct {
	MessageType uint16
	Message     []byte
}

type RecvHandler

type RecvHandler func(message *MessageData) *MessageData

type WebSocketServer

type WebSocketServer struct {
	service.Entity
	// contains filtered or unexported fields
}

func New

func New() *WebSocketServer

func (*WebSocketServer) AddHandler

func (webserv *WebSocketServer) AddHandler(messageType uint16, fun RecvHandler)

func (*WebSocketServer) Start

func (webserv *WebSocketServer) Start()

func (*WebSocketServer) Stop

func (webserv *WebSocketServer) Stop()

Directories

Path Synopsis
Package netpoll provides a portable interface for network I/O event notification facility.
Package netpoll provides a portable interface for network I/O event notification facility.

Jump to

Keyboard shortcuts

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