mqtt

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QOS_ZERO = 0 //MQTT.QoS = MQTT.QOS_ZERO
	QOS_ONE  = 1 //MQTT.QoS = MQTT.QOS_ONE
	QOS_TWO  = 2 //MQTT.QoS = MQTT.QOS_TWO
)

Variables

View Source
var (
	ErrNotSupportedProtocol = errors.New("not-supported-protocol")
	ErrConnect              = errors.New("error-connect")
)

Functions

func Connect

func Connect(id, addr string, options ...interface{}) (pubsub.PubSub, error)

Types

type Client

type Client struct {
	BrokerAddr       string        `json:"broker_addr"`
	ClientId         string        `json:"client_id"`
	QoS              byte          `json:"qos"` //MQTT.QoS
	PublishTimeout   time.Duration `json:"publish_timeout"`
	SubscribeTimeout time.Duration `json:"subscribe_timeout"`
	// contains filtered or unexported fields
}

func (*Client) Close

func (this *Client) Close()

func (*Client) Publish

func (this *Client) Publish(topic pubsub.Topic, message []byte) error

func (*Client) Subscribe

func (this *Client) Subscribe(topic pubsub.Topic) (<-chan []byte, error)

Jump to

Keyboard shortcuts

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