emq

package
v0.0.0-...-f42ee05 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultHandler root
	DefaultHandler = map[string]Handler{}
)

Functions

This section is empty.

Types

type Emq

type Emq struct {
	Cli         client.Client
	Opts        *client.ClientOptions
	Evt         chan client.Message
	SysProtocol map[string]client.MessageHandler
	BizProtocol map[string]Handler
	Cancel      context.CancelFunc
	Ctx         context.Context
	Version     string
}

Emq type

func (*Emq) Init

func (i *Emq) Init(opts []Option)

Init method

func (*Emq) Run

func (i *Emq) Run()

Run method

func (*Emq) Stop

func (i *Emq) Stop()

Stop method

type FSM

type FSM interface {
	Init(opts []Option)
	Run()
	Stop()
}

FSM interface

type Handler

type Handler func(*Emq, json.RawMessage) error

Handler func handler

type Option

type Option func(*Emq) error

Option def inject options to actor

func AddBizHandler

func AddBizHandler(topic string, handler Handler) Option

AddBizHandler option

func AddSysHandler

func AddSysHandler(topic string, handler client.MessageHandler) Option

AddSysHandler option

func MQTTConnectionLostHandler

func MQTTConnectionLostHandler(f client.ConnectionLostHandler) Option

MQTTConnectionLostHandler option

func MQTTOnConnectHandler

func MQTTOnConnectHandler(f client.OnConnectHandler) Option

MQTTOnConnectHandler option

func MQTTSettings

func MQTTSettings(Broker string, Username string, Password string) Option

MQTTSettings option

Jump to

Keyboard shortcuts

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