engine

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	OK_REQUEST                   int = -1
	UNKNOWN_TRANSPORT            int = 0
	UNKNOWN_SID                  int = 1
	BAD_HANDSHAKE_METHOD         int = 2
	BAD_REQUEST                  int = 3
	FORBIDDEN                    int = 4
	UNSUPPORTED_PROTOCOL_VERSION int = 5
)

Protocol errors mappings.

View Source
const Protocol = 4

Variables

This section is empty.

Functions

func NewServer

func NewServer(opt interface{}) *server

Types

type Server

type Server interface {
	events.EventEmitter

	SetHttpServer(*types.HttpServer)
	HttpServer() *types.HttpServer
	Opts() *config.ServerOptions
	Clients() *sync.Map
	ClientsCount() uint64
	Upgrades(string) *types.Set
	Close() Server
	HandleRequest(*types.HttpContext)
	HandleUpgrade(*types.HttpContext)
	Attach(*types.HttpServer, interface{})
	GenerateId(*types.HttpContext) (string, error)
}

func Attach

func Attach(server *types.HttpServer, options interface{}) Server

func Listen

func Listen(addr string, options interface{}, fn types.Callable) Server

func New

func New(server interface{}, args ...interface{}) Server

type Socket

type Socket interface {
	events.EventEmitter

	Id() string
	Server() Server
	Request() *types.HttpContext
	RemoteAddress() string
	Upgraded() bool
	Upgrading() bool
	MaybeUpgrade(transports.Transport)
	ReadyState() string
	SetReadyState(string)
	Transport() transports.Transport
	Send(io.Reader, *packet.Options, func(transports.Transport)) Socket
	Write(io.Reader, *packet.Options, func(transports.Transport)) Socket
	Close(bool)
}

func NewSocket

func NewSocket(id string, server Server, transport transports.Transport, ctx *types.HttpContext, protocol int) Socket

Jump to

Keyboard shortcuts

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