Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeConnReader ¶ added in v1.5.0
func NewFakeConnReader(frames []Frame) *fakeConnReader
func NewFakeConnWriter ¶ added in v1.5.0
func NewFakeConnWriter() *fakeConnWriter
func NewFakeConstReader ¶ added in v1.5.0
func NewFakeConstReader() *fakeConstReader
Types ¶
type Decoder ¶ added in v1.5.0
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(r FrameReader) *Decoder
func (*Decoder) NextReader ¶ added in v1.5.0
type Encoder ¶ added in v1.5.0
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(w FrameWriter) *Encoder
func (*Encoder) NextWriter ¶ added in v1.5.0
type FakeDiscardWriter ¶ added in v1.5.0
type FakeDiscardWriter struct{}
func (*FakeDiscardWriter) NextWriter ¶ added in v1.5.0
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 ¶ added in v1.5.0
type Type int
Type is the type of packet
const ( // OPEN is sent from the server when a new transport is opened (recheck). OPEN Type = iota // CLOSE is request the close of this transport but does not shutdown 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 a 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 ¶ added in v1.5.0
ByteToPacketType converts a byte to PacketType.
func (Type) BinaryByte ¶ added in v1.5.0
BinaryByte converts a PacketType to byte in binary.
func (Type) StringByte ¶ added in v1.5.0
StringByte converts a PacketType to byte in string.
Click to show internal directories.
Click to hide internal directories.