parser

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	Data []byte
	// contains filtered or unexported fields
}

Buffer is an binary buffer handler used in emit args. All buffers will be sent as binary in the transport layer.

func (Buffer) MarshalJSON

func (a Buffer) MarshalJSON() ([]byte, error)

MarshalJSON marshals to JSON.

func (*Buffer) UnmarshalJSON

func (a *Buffer) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals from JSON.

type Decoder

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

func NewDecoder

func NewDecoder(r FrameReader) *Decoder

func (*Decoder) Close

func (d *Decoder) Close() error

func (*Decoder) DecodeArgs

func (d *Decoder) DecodeArgs(types []reflect.Type) ([]reflect.Value, error)

func (*Decoder) DecodeHeader

func (d *Decoder) DecodeHeader(header *Header, event *string) error

func (*Decoder) DiscardLast

func (d *Decoder) DiscardLast() (err error)

type Encoder

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

func NewEncoder

func NewEncoder(w FrameWriter) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(h Header, args []interface{}) (err error)

type FrameReader

type FrameReader interface {
	NextReader() (engineio.FrameType, io.ReadCloser, error)
}

type FrameWriter

type FrameWriter interface {
	NextWriter(ft engineio.FrameType) (io.WriteCloser, error)
}
type Header struct {
	Type      Type
	Namespace string
	ID        uint64
	NeedAck   bool
}

Header of packet

type Type

type Type byte

Type of packet.

const (
	// Connect type
	Connect Type = iota
	// Disconnect type
	Disconnect
	// Event type
	Event
	// Ack type
	Ack
	// Error type
	Error
)

Jump to

Keyboard shortcuts

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