encoder

package
v6.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MPL-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeHeader

func EncodeHeader(packetType byte, header *packet.Header, remLength int, buff []byte) (int, error)

func WithStatRecorder

func WithStatRecorder(recorder StatRecorder) option

Types

type BufferProvider

type BufferProvider interface {
	New(size int) ([]byte, error)
}

type Encoder

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

func New

func New(opts ...option) *Encoder

func (*Encoder) ConnAck

func (e *Encoder) ConnAck(w io.Writer, p *packet.ConnAck) error

func (*Encoder) Encode

func (e *Encoder) Encode(w io.Writer, p packet.Packet) error

func (*Encoder) Marshal

func (e *Encoder) Marshal(p packet.Packet) ([]byte, error)

func (*Encoder) PingResp

func (e *Encoder) PingResp(w io.Writer, p *packet.PingResp) error

func (*Encoder) PubAck

func (e *Encoder) PubAck(w io.Writer, p *packet.PubAck) error

func (*Encoder) Publish

func (e *Encoder) Publish(w io.Writer, p *packet.Publish) error

func (*Encoder) SubAck

func (e *Encoder) SubAck(w io.Writer, p *packet.SubAck) error

func (*Encoder) UnsubAck

func (e *Encoder) UnsubAck(w io.Writer, p *packet.UnsubAck) error

type StatRecorder

type StatRecorder interface {
	Add(float64)
}

Jump to

Keyboard shortcuts

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