socketio

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

This package supports a tiny subset of the Socket.IO protocol. For now it only supports websockets, not long-polling.

Index

Constants

View Source
const (
	EngineIOVersion = "4"
	Transport       = "websocket"
)
View Source
const (
	PacketTypeConnect      PacketType = iota
	PacketTypeDisconnect              = iota
	PacketTypeEvent                   = iota
	PacketTypeAck                     = iota
	PacketTypeConnectError            = iota
	PacketTypeBinaryEvent             = iota
	PacketTypeBinaryAck               = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(server string, ts oauth2.TokenSource) *Client

New creates a Client for receiving events from a Socket.IO server.

func (*Client) HandleEvents

func (c *Client) HandleEvents(ctx context.Context, h func(name string, msg string) error) error

type PacketType

type PacketType int

PacketType is the SocketIO packet type.

const (
	EIOPacketTypeOpen PacketType = iota
	EIOPacketTypeClose
	EIOPacketTypePing
	EIOPacketTypePong
	EIOPacketTypeMessage
	EIOPacketTypeUpgrade
	EIOPacketTypeNoop
)

Jump to

Keyboard shortcuts

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