socketio_client

package module
v0.0.0-...-cd6c0e1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

README

go-socket-io-client

Socket.io Client lib Written in Golang

Documentation

Index

Constants

View Source
const (
	ON_CONNECTED    = "connected"
	ON_DISCONNECTED = "disconnected"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OnEventMessage

type OnEventMessage map[string]interface{}

type OnEvents

type OnEvents map[string]func(OnEventMessage)

type Socket

type Socket struct {
	Sid          string `json:"sid"`
	PingInterval int    `json:"pinginterval"`
	PingTimeout  int    `json:"pingtimeout"`
}

type WebSocketClient

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

func Initiate

func Initiate(schema, host, channel string, rawQuery string, websocketClosed chan bool) *WebSocketClient

NewWebSocketClient create new websocket connection

func (*WebSocketClient) Emit

func (conn *WebSocketClient) Emit(eventName, message string) error

func (*WebSocketClient) GetSocket

func (conn *WebSocketClient) GetSocket() (*websocket.Conn, error)

func (*WebSocketClient) IsClosed

func (conn *WebSocketClient) IsClosed() bool

func (*WebSocketClient) Join

func (conn *WebSocketClient) Join(channelname string)

func (*WebSocketClient) On

func (conn *WebSocketClient) On(eventName string, event func(OnEventMessage))

func (*WebSocketClient) Shutdown

func (conn *WebSocketClient) Shutdown()

Close will send close message and shutdown websocket connection

func (*WebSocketClient) StartSocket

func (conn *WebSocketClient) StartSocket() error

func (*WebSocketClient) Write

func (conn *WebSocketClient) Write(payload interface{}) error

Write data to the websocket server

Directories

Path Synopsis
l

Jump to

Keyboard shortcuts

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