sckio

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string) *sckServer

Types

type AppSocket

type AppSocket interface {
	ServiceContext() goservice.ServiceContext
	Logger() logger.Logger
	CurrentUser() sdkcm.Requester
	SetCurrentUser(sdkcm.Requester)
	BroadcastToRoom(room, event string, args ...interface{})
	String() string
	Socket
}

type Config

type Config struct {
	Name          string
	MaxConnection int
}

type ObserverProvider

type ObserverProvider interface {
	AddObservers(server *socketio.Server, sc goservice.ServiceContext, l logger.Logger) func(socketio.Socket)
}

type Socket

type Socket interface {
	Id() string
	Rooms() []string
	Request() *http.Request
	On(event string, f interface{}) error
	Emit(event string, args ...interface{}) error
	Join(room string) error
	Leave(room string) error
	Disconnect()
	BroadcastTo(room, event string, args ...interface{}) error
}

Jump to

Keyboard shortcuts

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