Documentation ¶
Overview ¶
*
- ______ __
- /\__ _\ /\ \
- \/_/\ \/ ___ __\ \ \ __ ___ ___ __
- \ \ \ / ___\ / __ \ \ \ __ / __ \ / _ \ / ___\ / __ \
- \_\ \__/\ \__//\ __/\ \ \_\ \/\ \_\ \_/\ \/\ \/\ \__//\ __/
- /\_____\ \____\ \____\\ \____/\ \__/ \_\ \_\ \_\ \____\ \____\
- \/_____/\/____/\/____/ \/___/ \/__/\/_/\/_/\/_/\/____/\/____/ * *
- @寒冰
- www.icezzz.cn
- hanbin020706@163.com
*
- ______ __
- /\__ _\ /\ \
- \/_/\ \/ ___ __\ \ \ __ ___ ___ __
- \ \ \ / ___\ / __ \ \ \ __ / __ \ / _ \ / ___\ / __ \
- \_\ \__/\ \__//\ __/\ \ \_\ \/\ \_\ \_/\ \/\ \/\ \__//\ __/
- /\_____\ \____\ \____\\ \____/\ \__/ \_\ \_\ \_\ \____\ \____\
- \/_____/\/____/\/____/ \/___/ \/__/\/_/\/_/\/_/\/____/\/____/ * *
- @寒冰
- www.icezzz.cn
- hanbin020706@163.com
Index ¶
Constants ¶
View Source
const (
DataSliceLength = 1400
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) EnCoder ¶
func (u *Connection) EnCoder(message []byte, messageType uint16) [][]byte
func (*Connection) GetName ¶
func (u *Connection) GetName() string
type ConnectionGroup ¶
type ConnectionGroup struct { Hanlder *Handler // contains filtered or unexported fields }
func NewGroup ¶
func NewGroup(pool *gopool.Pool) *ConnectionGroup
func (*ConnectionGroup) Register ¶
func (c *ConnectionGroup) Register(conn net.Conn) *Connection
Register registers new connection as a User.
func (*ConnectionGroup) Remove ¶
func (c *ConnectionGroup) Remove(user *Connection)
Remove removes user from chat.
func (*ConnectionGroup) Rename ¶
func (c *ConnectionGroup) 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
type MessageData ¶
type NetManager ¶
type NetManager struct { Pool *gopool.Pool Poller netpoll.Poller Group *ConnectionGroup }
func NewNetManager ¶
func NewNetManager() *NetManager
type RecvHandler ¶
type RecvHandler func(message *MessageData) *MessageData
Click to show internal directories.
Click to hide internal directories.