mqtt

package
v0.0.0-...-e0071fa Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Rserved = iota
	CONNECT
	CONNACK

	PUBLISH
	PUBACK
	PUBREC
	PUBREL
	PUBCOMP

	SUBSCRIBE
	SUBACK

	UNSUBSCRIBE
	UNSUBACK

	PINGREQ
	PINGRESP

	DISCONNECT
)

Variables

This section is empty.

Functions

func DelayWritePack

func DelayWritePack(pack *Pack, w *bufio.Writer) (err error)

func WritePack

func WritePack(pack *Pack, w *bufio.Writer) error

Types

type Connack

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

func (*Connack) GetReturnCode

func (c *Connack) GetReturnCode() byte

func (*Connack) SetReturnCode

func (c *Connack) SetReturnCode(return_code byte)

type Connect

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

func (*Connect) GetKeepAlive

func (c *Connect) GetKeepAlive() int

func (*Connect) GetPassword

func (c *Connect) GetPassword() *string

func (*Connect) GetReturnCode

func (c *Connect) GetReturnCode() byte

func (*Connect) GetUserName

func (c *Connect) GetUserName() *string

func (*Connect) GetWillMsg

func (c *Connect) GetWillMsg() (bool, *string, *string)

func (*Connect) IsCleanSession

func (c *Connect) IsCleanSession() bool

type Pack

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

func GetConnAckPack

func GetConnAckPack(return_code byte) *Pack

Get a connection ack pack

func GetPingResp

func GetPingResp(qos byte, dup byte) *Pack

Get a request for ping pack

func GetPubPack

func GetPubPack(qos byte, dup byte, mid int, topic *string, msg []byte) *Pack

Get a publis pack

func ReadPack

func ReadPack(r *bufio.Reader) (pack *Pack, err error)

Read and Write a mqtt pack

func (*Pack) GetDup

func (pack *Pack) GetDup() byte

func (*Pack) GetQos

func (pack *Pack) GetQos() byte

func (*Pack) GetType

func (pack *Pack) GetType() byte

func (*Pack) GetVariable

func (pack *Pack) GetVariable() interface{}

func (*Pack) SetDup

func (pack *Pack) SetDup(dup byte)

func (*Pack) SetQos

func (pack *Pack) SetQos(qos byte)

func (*Pack) SetType

func (pack *Pack) SetType(typ byte)

type Puback

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

func (*Puback) GetMid

func (ack *Puback) GetMid() int

func (*Puback) SetMid

func (ack *Puback) SetMid(id int)

type Publish

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

func (*Publish) GetMid

func (pub *Publish) GetMid() int

func (*Publish) GetMsg

func (pub *Publish) GetMsg() []byte

func (*Publish) GetTopic

func (pub *Publish) GetTopic() *string

func (*Publish) SetMid

func (pub *Publish) SetMid(id int)

func (*Publish) SetMsg

func (pub *Publish) SetMsg(msg []byte)

func (*Publish) SetTopic

func (pub *Publish) SetTopic(topic *string)

Jump to

Keyboard shortcuts

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