bot

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetMQTTBot

func ResetMQTTBot()

ResetMQTTBot clears once and mqttbot instance

func RouteIncludesTopic

func RouteIncludesTopic(route []string, topic []string) bool

RouteIncludesTopic returns if the topic matches the given route

Types

type MQTTBot

type MQTTBot struct {
	Plugins       *plugins.Plugins
	Subscriptions []*Subscription
	Client        *mqttclient.MQTTClient
	Config        *viper.Viper
}

MQTTBot defines the bot, it contains plugins, subscriptions and a client

func GetMQTTBot

func GetMQTTBot() *MQTTBot

GetMQTTBot returns a initialized mqtt bot

func (*MQTTBot) StartBot

func (b *MQTTBot) StartBot()

StartBot starts the bot, it subscribes the bot to the topics defined in the configuration file

type PluginMapping

type PluginMapping struct {
	Plugin         string
	MessagePattern string
}

PluginMapping defines the plugin to listen to given patterns

type Subscription

type Subscription struct {
	Topic          string
	Qos            int
	PluginMappings []*PluginMapping
}

Subscription defines the plugin mappings to a given topic

Jump to

Keyboard shortcuts

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