gemq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTokenTimeout declare
	ErrTokenTimeout = errors.New("等待emq服务器Token超时")
	Inc             = new(Emq)
)
View Source
var API = new(AuthAPI)

Functions

func DailWithOption added in v1.0.0

func DailWithOption(opt DialOptions) (c mqtt.Client, err error)

Types

type AuthAPI

type AuthAPI struct {
	AuthFunc func(c iris.Context, d *mqttData) (err error)
}

func (*AuthAPI) ACL

func (a *AuthAPI) ACL(d *mqttData) (err error)

ACL ......

func (*AuthAPI) Auth

func (a *AuthAPI) Auth(c iris.Context, d *mqttData) (err error)

Auth ......

func (*AuthAPI) Handle

func (a *AuthAPI) Handle(r iris.Party) iris.Party

Handle ...

type DialOptions added in v1.0.0

type DialOptions struct {
	AppName  string
	Broker   string
	Username string
	Password string
}

type Emq

type Emq struct {
	Config *config.Config `inject:""`
	Logger util.ItfLogger `inject:""`
	// contains filtered or unexported fields
}

Emq ...

func (*Emq) Client

func (e *Emq) Client() mqtt.Client

Client ...

func (*Emq) Constructor

func (e *Emq) Constructor()

Constructor ...

func (*Emq) Dial

func (e *Emq) Dial()

Dial ...

func (*Emq) EmqSuperAuth

func (e *Emq) EmqSuperAuth() (username, password string)

EmqSuperAuth ...

func (*Emq) PublishC

func (e *Emq) PublishC(topic string, payload interface{})

PublishC ... publish in channel

func (*Emq) Subscribe

func (e *Emq) Subscribe(topic string, callback mqtt.MessageHandler) (err error)

Subscribe ...

Jump to

Keyboard shortcuts

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