sockio

package
v0.0.0-...-4ea7438 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
}

func NewClient

func NewClient() *Client

func (*Client) Start

func (c *Client) Start()

type Server

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

func NewServer

func NewServer(conf SockConf) *Server

func (*Server) AddEvent

func (e *Server) AddEvent(event SocketEvent)

AddEvent 添加事件

func (*Server) AddEvents

func (e *Server) AddEvents(events []SocketEvent)

AddEvents 添加多个事件

func (*Server) GetSocketIO

func (e *Server) GetSocketIO() *socketio.Server

GetSocketIO GetSocketIO

func (*Server) Start

func (e *Server) Start()

func (*Server) Stop

func (e *Server) Stop()

func (*Server) Use

func (e *Server) Use(next gin.HandlerFunc)

Use 中间件

type SockConf

type SockConf struct {
	Host string
	Port int
}

type SocketEvent

type SocketEvent struct {
	NameSpace string
	Event     string
	Handler   interface{} //func(s socketio.Conn, msg string),func(s socketio.Conn, msg string) string,func(s socketio.Conn) string,
}

SocketEvent SocketEvent

Jump to

Keyboard shortcuts

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