SocketIO

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 22 Imported by: 0

README

Socket.IO and Go-FTL

This has been tested to work with version 1.4.7 through 1.7.4 of Socket.IO. A newer version of this will work with version 2.x of Socket.IO.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessTemplate

func ProcessTemplate(tmpl string, subs ...string) (rv string)

Types

type SioRoutesType

type SioRoutesType struct {
	RouteName       string // sio://<NAME>/<Path>
	RouteDest       string // chat-bot			-- template, chat-bot:%{Id%}
	RouteReply      string // r:chat-bot		-- item to listen to for replies from this server
	PingMsg         string // /chat-bot-ping	-- Path to send to server to ask if alive
	MsgIfNoPingMsg  string // r:no-server		-- Timeout on PingMessage - results in...
	MsgIfNoPingBody string // NoServerAvailable -- and this for a body
	PingTimeout     uint64 //					-- Time to wait for a ping-reply
}

type SocketIOHandlerType

type SocketIOHandlerType struct {
	Next              http.Handler    //
	Paths             []string        // Paths that this will work for
	InternalRequestPw string          //
	ListClientApi     string          //
	ApiEnableIR       string          //
	ApiEnableRR       string          //
	MessagePrefix     string          // Template using sizlib.Qt ( quick template ) - the destination to publish to
	MessageRespPrefix string          // Responce Listen to - where to get back responses - xyzzy - not a template yet - dont't know how to use patterns for listen
	SioRoutes         []SioRoutesType //
	LineNo            int             //

	LookupIds    map[string]*SocketIdType //
	LookupTrxIds map[string]string        //
	// contains filtered or unexported fields
}

func NewSocketIOServer

func NewSocketIOServer(n http.Handler, p []string, pf, pr string) *SocketIOHandlerType

func (*SocketIOHandlerType) AssociateId

func (hdlr *SocketIOHandlerType) AssociateId(Id string, so socketio.Socket)

func (*SocketIOHandlerType) AssociateTrxId

func (hdlr *SocketIOHandlerType) AssociateTrxId(Id, TrxId string)

func (*SocketIOHandlerType) DisassociateId

func (hdlr *SocketIOHandlerType) DisassociateId(id string)

func (*SocketIOHandlerType) GetTrxId

func (hdlr *SocketIOHandlerType) GetTrxId(Id string) (TrxId string)

func (*SocketIOHandlerType) InitChatServer

func (hdlr *SocketIOHandlerType) InitChatServer()

func (*SocketIOHandlerType) InitializeWithConfigData

func (hdlr *SocketIOHandlerType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, pNo, callNo int) (err error)

func (*SocketIOHandlerType) ListenFor

func (hdlr *SocketIOHandlerType) ListenFor(server *socketio.Server)

func (*SocketIOHandlerType) LookupSocketFromId

func (hdlr *SocketIOHandlerType) LookupSocketFromId(id string) (so socketio.Socket, err error)

func (*SocketIOHandlerType) PreValidate

func (hdlr *SocketIOHandlerType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, serverName string, pNo, callNo int) (err error)

func (*SocketIOHandlerType) Publish

func (hdlr *SocketIOHandlerType) Publish(Id, msg string)

func (*SocketIOHandlerType) ServeHTTP

func (hdlr *SocketIOHandlerType) ServeHTTP(www http.ResponseWriter, req *http.Request)

type SocketIdType

type SocketIdType struct {
	Id    string
	TrxId string
	So    socketio.Socket
}

Jump to

Keyboard shortcuts

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