socket

package
v0.0.0-...-5115f5b Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenServer

func GenServer() (*socketio.Server, error)

Types

type IWrapper

type IWrapper interface {
	OnConnect(nsp string, f func(echo.Context, socketio.Conn) error)
	OnDisconnect(nsp string, f func(echo.Context, socketio.Conn, string))
	OnError(nsp string, f func(echo.Context, error))
	OnEvent(nsp, event string, f func(echo.Context, socketio.Conn, string))
	HandlerFunc(context echo.Context) error
}

Socket.io wrapper interface

type Wrapper

type Wrapper struct {
	Context echo.Context
	Server  *socketio.Server
}

func NewWrapper

func NewWrapper(options *engineio.Options) (*Wrapper, error)

Create wrapper and Socket.io server

func NewWrapperWithServer

func NewWrapperWithServer(server *socketio.Server) (*Wrapper, error)

Create wrapper with exists Socket.io server

func (*Wrapper) HandlerFunc

func (s *Wrapper) HandlerFunc(context echo.Context) error

Handler function

func (*Wrapper) OnConnect

func (s *Wrapper) OnConnect(nsp string, f func(echo.Context, socketio.Conn) error)

On Socket.io client connect

func (*Wrapper) OnDisconnect

func (s *Wrapper) OnDisconnect(nsp string, f func(echo.Context, socketio.Conn, string))

On Socket.io client disconnect

func (*Wrapper) OnError

func (s *Wrapper) OnError(nsp string, f func(echo.Context, error))

On Socket.io error

func (*Wrapper) OnEvent

func (s *Wrapper) OnEvent(nsp, event string, f func(echo.Context, socketio.Conn, string))

On Socket.io event from client

Jump to

Keyboard shortcuts

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