Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeConstReader ¶
func NewFakeConstReader() *fakeConstReader
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(r FrameReader) *Decoder
func (*Decoder) NextReader ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(w FrameWriter) *Encoder
func (*Encoder) NextWriter ¶
type FakeDiscardWriter ¶
type FakeDiscardWriter struct{}
func (*FakeDiscardWriter) NextWriter ¶
func (w *FakeDiscardWriter) NextWriter(fType frame.Type) (io.WriteCloser, error)
type FrameReader ¶
type FrameReader interface {
NextReader() (frame.Type, io.ReadCloser, error)
}
FrameReader is the reader which supports framing.
type FrameWriter ¶
type FrameWriter interface {
NextWriter(typ frame.Type) (io.WriteCloser, error)
}
FrameWriter is the writer which supports framing.
type Type ¶
type Type int
Type is the type of packet
const ( // OPEN is sent from the server when new transport is opened (recheck). OPEN Type = iota // CLOSE is request the close of this transport but does not shut down the // connection itself. CLOSE // PING is sent by the client. Server should answer with a pong packet // containing the same data. PING // PONG is sent by the server to respond to ping packets. PONG // MESSAGE is actual message, client and server should call their callbacks // with the data. MESSAGE // UPGRADE is sent before engine.io switches transport to test if server // and client can communicate over this transport. If this test succeed, // the client sends an upgrade packets which requests the server to flush // its cache on the old transport and switch to the new transport. UPGRADE // NOOP is a noop packet. Used primarily to force a poll cycle when an // incoming websocket connection is received. NOOP )
func ByteToPacketType ¶
ByteToPacketType converts a byte to PacketType.
func (Type) BinaryByte ¶
BinaryByte converts a PacketType to byte in binary.
func (Type) StringByte ¶
StringByte converts a PacketType to byte in string.
Click to show internal directories.
Click to hide internal directories.