engine

package
v0.0.0-...-394f01a Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	MessageChan chan *Message // 处理MQTT消息的队列
	// contains filtered or unexported fields
}

func (*Engine) Close

func (e *Engine) Close()

func (*Engine) Dial

func (e *Engine) Dial() error

func (*Engine) Release

func (e *Engine) Release()

func (*Engine) Start

func (e *Engine) Start(ctx context.Context) error

type EngineHelper

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

func NewEngineHelper

func NewEngineHelper() *EngineHelper

func (*EngineHelper) AddClient

func (m *EngineHelper) AddClient(tag string, address string, opts ...MqttOption) error

func (*EngineHelper) AddRouting

func (e *EngineHelper) AddRouting(fromTags, toTags, topicTags []string)

func (*EngineHelper) AddTopicFilter

func (e *EngineHelper) AddTopicFilter(tag string, qos byte, filter ...string) error

func (*EngineHelper) BuildEngine

func (e *EngineHelper) BuildEngine() (*Engine, error)

type Message

type Message struct {
	FromTag string
	Topic   string
	Payload []byte
}

type MqttAddress

type MqttAddress struct {
	Address  string
	UserName string
	Password string
}

type MqttOption

type MqttOption func(*MqttAddress)

type Node

type Node struct {
	Value string
	Child map[string]*Node
}

type Router

type Router struct {
	FromTags  []string
	ToTags    []string
	TopicTags []string
}

type SubTopic

type SubTopic struct {
	Topic string
	Qos   byte
}

type TopicFilter

type TopicFilter struct {
	Tag    string
	Qos    byte
	Filter []string
}

type TopicFilterTree

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

func NewTopicFilterTree

func NewTopicFilterTree() *TopicFilterTree

func (*TopicFilterTree) AddFilter

func (t *TopicFilterTree) AddFilter(topics ...string) *TopicFilterTree

func (*TopicFilterTree) MathFilter

func (t *TopicFilterTree) MathFilter(topic string) (string, error)

Jump to

Keyboard shortcuts

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