engineio

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, conn gomasio.Conn, handler Handler) error

func NewWriter

func NewWriter(wf gomasio.WriteFlusher, packetType PacketType) gomasio.WriteFlusher

func WritePing

func WritePing(w io.Writer) error

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode() (*Packet, error)

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(packet *Packet) error

type HandleFunc

type HandleFunc func(wf gomasio.WriterFactory, body io.Reader)

func (HandleFunc) HandleMessage

func (f HandleFunc) HandleMessage(wf gomasio.WriterFactory, body io.Reader)

type Handler

type Handler interface {
	HandleMessage(wf gomasio.WriterFactory, body io.Reader)
}

type Packet

type Packet struct {
	Type PacketType
	Body io.Reader
}

type PacketType

type PacketType int
const (
	OPEN PacketType = iota
	CLOSE
	PING
	PONG
	MESSAGE
	UPGRADE
	NOOP

	INVALID PacketType = -1
)

type Session

type Session struct {
	ID           string `json:"sid"`
	PingInterval int    `json:"pingInterval"`
	PingTimeout  int    `json:"pingTimeout"`
}

Jump to

Keyboard shortcuts

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